Skip to content

Commit

Permalink
fix: Feature flag 'import zero balance account' feature for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick1904 committed May 6, 2022
1 parent d4898a1 commit e10f4d3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions features/features.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Features = {
EXAMPLE_FLAG: boolean;
FARMING_VALIDATOR_APY_DISPLAY: boolean;
IMPORT_ACCOUNT_WITH_LINK_V2: boolean;
IMPORT_ZERO_BALANCE_ACCOUNT: boolean;
USE_INDEXER_SERVICE: boolean;
USN_BUTTON: boolean;
};
29 changes: 29 additions & 0 deletions features/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,35 @@
"lastEditedAt": "2022-04-07T02:50:24.123Z"
}
},
"IMPORT_ZERO_BALANCE_ACCOUNT": {
"createdBy": "Patrick Tajima",
"createdAt": "2022-05-06T17:30:49.430Z",
"development": {
"enabled": false,
"lastEditedBy": "Patrick Tajima",
"lastEditedAt": "2022-05-06T17:30:49.429Z"
},
"testnet": {
"enabled": true,
"lastEditedBy": "Patrick Tajima",
"lastEditedAt": "2022-05-06T17:30:49.430Z"
},
"mainnet": {
"enabled": false,
"lastEditedBy": "Patrick Tajima",
"lastEditedAt": "2022-05-06T17:30:49.430Z"
},
"mainnet_STAGING": {
"enabled": false,
"lastEditedBy": "Patrick Tajima",
"lastEditedAt": "2022-05-06T17:30:49.430Z"
},
"testnet_STAGING": {
"enabled": true,
"lastEditedBy": "Patrick Tajima",
"lastEditedAt": "2022-05-06T17:30:49.430Z"
}
},
"USE_INDEXER_SERVICE": {
"createdBy": "Andy Haynes",
"createdAt": "2022-05-05T21:19:46.314Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import styled from 'styled-components';


import { IMPORT_ZERO_BALANCE_ACCOUNT } from '../../../../../features';
import { Mixpanel } from '../../mixpanel/index';
import {
recoverAccountSeedPhrase,
Expand Down Expand Up @@ -107,9 +107,13 @@ class RecoverAccountSeedPhrase extends Component {
await recoverAccountSeedPhrase(seedPhrase);
await refreshAccount();
}, (e) => {
if (e.message.includes('Cannot find matching public key')) {
this.setState({ showCouldNotFindAccountModal: true });

if (IMPORT_ZERO_BALANCE_ACCOUNT) {
if (e.message.includes('Cannot find matching public key')) {
this.setState({ showCouldNotFindAccountModal: true });
}
}

throw e;
}, () => {
this.setState({ recoveringAccount: false });
Expand Down

0 comments on commit e10f4d3

Please sign in to comment.