Skip to content

Commit b3eb602

Browse files
authored
Merge pull request #2753 from near/master
2022-06-15 Release
2 parents e63b84f + bb25361 commit b3eb602

28 files changed

+287
-725
lines changed

features/features.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@
44
export type Features = {
55
CREATE_USN_CONTRACT: boolean;
66
DONATE_TO_UKRAINE: boolean;
7-
EXAMPLE_FLAG: boolean;
8-
IMPORT_ACCOUNT_WITH_LINK_V2: boolean;
9-
IMPORT_ZERO_BALANCE_ACCOUNT: boolean;
107
};

features/flags.json

Lines changed: 0 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -86,137 +86,5 @@
8686
"lastEditedBy": "esaminu",
8787
"lastEditedAt": "2022-05-10T17:07:20.351Z"
8888
}
89-
},
90-
"EXAMPLE_FLAG": {
91-
"createdBy": "Daryl Collins",
92-
"createdAt": "2021-05-24T09:33:27.489Z",
93-
"development": {
94-
"enabled": true,
95-
"lastEditedBy": "Daryl Collins",
96-
"lastEditedAt": "2021-05-24T09:33:27.489Z"
97-
},
98-
"testnet": {
99-
"enabled": true,
100-
"lastEditedBy": "Daryl Collins",
101-
"lastEditedAt": "2021-11-09T04:34:12.847Z"
102-
},
103-
"mainnet": {
104-
"enabled": true,
105-
"lastEditedBy": "Andy Haynes",
106-
"lastEditedAt": "2021-10-22T23:08:35.672Z"
107-
},
108-
"mainnet_STAGING": {
109-
"enabled": false,
110-
"lastEditedBy": "Daryl Collins",
111-
"lastEditedAt": "2021-05-24T09:33:27.489Z"
112-
},
113-
"testnet_STAGING": {
114-
"enabled": true,
115-
"lastEditedBy": "Andy Haynes",
116-
"lastEditedAt": "2022-01-31T21:13:09.948Z"
117-
},
118-
"testnet_NEARORG": {
119-
"enabled": true,
120-
"lastEditedBy": "esaminu",
121-
"lastEditedAt": "2022-05-05T18:07:50.110Z"
122-
},
123-
"mainnet_NEARORG": {
124-
"enabled": true,
125-
"lastEditedBy": "esaminu",
126-
"lastEditedAt": "2022-05-05T18:06:54.374Z"
127-
},
128-
"mainnet_STAGING_NEARORG": {
129-
"enabled": false,
130-
"lastEditedBy": "esaminu",
131-
"lastEditedAt": "2022-05-05T18:07:28.665Z"
132-
}
133-
},
134-
"IMPORT_ACCOUNT_WITH_LINK_V2": {
135-
"createdBy": "Patrick Tajima",
136-
"createdAt": "2022-03-12T01:30:32.577Z",
137-
"development": {
138-
"enabled": true,
139-
"lastEditedBy": "Patrick Tajima",
140-
"lastEditedAt": "2022-03-12T01:30:32.577Z"
141-
},
142-
"testnet": {
143-
"enabled": true,
144-
"lastEditedBy": "Patrick Tajima",
145-
"lastEditedAt": "2022-04-07T02:50:24.122Z"
146-
},
147-
"mainnet": {
148-
"enabled": true,
149-
"lastEditedBy": "Patrick Tajima",
150-
"lastEditedAt": "2022-04-07T02:50:24.123Z"
151-
},
152-
"mainnet_STAGING": {
153-
"enabled": true,
154-
"lastEditedBy": "Patrick Tajima",
155-
"lastEditedAt": "2022-04-07T02:50:24.123Z"
156-
},
157-
"testnet_STAGING": {
158-
"enabled": true,
159-
"lastEditedBy": "Patrick Tajima",
160-
"lastEditedAt": "2022-04-07T02:50:24.123Z"
161-
},
162-
"testnet_NEARORG": {
163-
"enabled": true,
164-
"lastEditedBy": "esaminu",
165-
"lastEditedAt": "2022-05-05T18:07:50.110Z"
166-
},
167-
"mainnet_NEARORG": {
168-
"enabled": true,
169-
"lastEditedBy": "esaminu",
170-
"lastEditedAt": "2022-05-05T18:06:54.374Z"
171-
},
172-
"mainnet_STAGING_NEARORG": {
173-
"enabled": true,
174-
"lastEditedBy": "esaminu",
175-
"lastEditedAt": "2022-05-05T18:07:28.665Z"
176-
}
177-
},
178-
"IMPORT_ZERO_BALANCE_ACCOUNT": {
179-
"createdBy": "Patrick Tajima",
180-
"createdAt": "2022-05-06T17:30:49.430Z",
181-
"development": {
182-
"enabled": true,
183-
"lastEditedBy": "Patrick Tajima",
184-
"lastEditedAt": "2022-05-24T23:56:29.721Z"
185-
},
186-
"testnet": {
187-
"enabled": true,
188-
"lastEditedBy": "Patrick Tajima",
189-
"lastEditedAt": "2022-05-24T23:56:29.721Z"
190-
},
191-
"mainnet": {
192-
"enabled": true,
193-
"lastEditedBy": "Patrick Tajima",
194-
"lastEditedAt": "2022-05-27T17:30:49.430Z"
195-
},
196-
"mainnet_STAGING": {
197-
"enabled": true,
198-
"lastEditedBy": "Patrick Tajima",
199-
"lastEditedAt": "2022-05-24T23:56:29.721Z"
200-
},
201-
"testnet_STAGING": {
202-
"enabled": true,
203-
"lastEditedBy": "Patrick Tajima",
204-
"lastEditedAt": "2022-05-24T23:56:29.721Z"
205-
},
206-
"testnet_NEARORG": {
207-
"enabled": true,
208-
"lastEditedBy": "Patrick Tajima",
209-
"lastEditedAt": "2022-05-24T23:56:29.721Z"
210-
},
211-
"mainnet_NEARORG": {
212-
"enabled": true,
213-
"lastEditedBy": "esaminu",
214-
"lastEditedAt": "2022-05-27T23:34:05.414Z"
215-
},
216-
"mainnet_STAGING_NEARORG": {
217-
"enabled": true,
218-
"lastEditedBy": "Patrick Tajima",
219-
"lastEditedAt": "2022-05-24T23:56:29.721Z"
220-
}
22189
}
22290
}

packages/frontend/src/ExampleFlag.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/frontend/src/components/Routing.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import { connect } from 'react-redux';
1010
import { Redirect, Switch } from 'react-router-dom';
1111
import styled, { ThemeProvider } from 'styled-components';
1212

13-
import {
14-
IMPORT_ACCOUNT_WITH_LINK_V2,
15-
} from '../../../../features';
1613
import favicon from '../../src/images/mynearwallet-cropped.svg';
1714
import TwoFactorVerifyModal from '../components/accounts/two_factor/TwoFactorVerifyModal';
1815
import {
@@ -22,7 +19,6 @@ import {
2219
DISABLE_CREATE_ACCOUNT,
2320
} from '../config';
2421
import { isWhitelabel } from '../config/whitelabel';
25-
import ExampleFlag from '../ExampleFlag';
2622
import { Mixpanel } from '../mixpanel/index';
2723
import * as accountActions from '../redux/actions/account';
2824
import { handleClearAlert } from '../redux/reducers/status';
@@ -71,7 +67,6 @@ import { SignInLedgerWrapper } from './accounts/ledger/SignInLedgerWrapper';
7167
import { LinkdropLandingWithRouter } from './accounts/LinkdropLanding';
7268
import { RecoverAccountSeedPhraseWithRouter } from './accounts/RecoverAccountSeedPhrase';
7369
import { RecoverAccountWrapper } from './accounts/RecoverAccountWrapper';
74-
import { RecoverWithLinkWithRouter } from './accounts/RecoverWithLink';
7570
import { SetupRecoveryMethodWithRouter } from './accounts/recovery_setup/SetupRecoveryMethod';
7671
import { SetupImplicitWithRouter } from './accounts/SetupImplicit';
7772
import { SetupSeedPhraseWithRouter } from './accounts/SetupSeedPhrase';
@@ -381,11 +376,6 @@ class Routing extends Component {
381376
search: search,
382377
}}
383378
/>
384-
<Route
385-
exact
386-
path="/example_flag"
387-
component={ExampleFlag}
388-
/>
389379
<GuestLandingRoute
390380
exact
391381
path="/"
@@ -514,11 +504,7 @@ class Routing extends Component {
514504
<Route
515505
exact
516506
path="/recover-with-link/:accountId/:seedPhrase"
517-
component={
518-
IMPORT_ACCOUNT_WITH_LINK_V2
519-
? ImportAccountWithLinkWrapper
520-
: RecoverWithLinkWithRouter
521-
}
507+
component={ImportAccountWithLinkWrapper}
522508
/>
523509
<Route
524510
exact

packages/frontend/src/components/accounts/CouldNotFindAccountModal.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/frontend/src/components/accounts/RecoverAccountSeedPhrase.js

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { connect } from 'react-redux';
66
import { withRouter } from 'react-router-dom';
77
import styled from 'styled-components';
88

9-
import { IMPORT_ZERO_BALANCE_ACCOUNT } from '../../../../../features';
109
import { Mixpanel } from '../../mixpanel/index';
1110
import {
1211
recoverAccountSeedPhrase,
@@ -15,15 +14,18 @@ import {
1514
refreshAccount,
1615
clearAccountState
1716
} from '../../redux/actions/account';
18-
import { clearLocalAlert, showCustomAlert } from '../../redux/actions/status';
17+
import { clearLocalAlert, showCustomAlert, clearGlobalAlert } from '../../redux/actions/status';
1918
import { selectAccountSlice } from '../../redux/slices/account';
19+
import { actions as importZeroBalanceAccountActions } from '../../redux/slices/importZeroBalanceAccount';
20+
import { importZeroBalanceAccountPhrase } from '../../redux/slices/importZeroBalanceAccount/importAccountThunks';
2021
import { selectActionsPending, selectStatusLocalAlert, selectStatusMainLoader } from '../../redux/slices/status';
2122
import isValidSeedPhrase from '../../utils/isValidSeedPhrase';
2223
import parseFundingOptions from '../../utils/parseFundingOptions';
2324
import Container from '../common/styled/Container.css';
24-
import { CouldNotFindAccountModalWrapper } from './CouldNotFindAccountModalWrapper';
2525
import RecoverAccountSeedPhraseForm from './RecoverAccountSeedPhraseForm';
2626

27+
const { setZeroBalanceAccountImportMethod } = importZeroBalanceAccountActions;
28+
2729
const StyledContainer = styled(Container)`
2830
.input {
2931
width: 100%;
@@ -83,7 +85,9 @@ class RecoverAccountSeedPhrase extends Component {
8385
clearAccountState,
8486
recoverAccountSeedPhrase,
8587
refreshAccount,
86-
showCustomAlert
88+
showCustomAlert,
89+
importZeroBalanceAccountPhrase,
90+
setZeroBalanceAccountImportMethod
8791
} = this.props;
8892

8993
try {
@@ -103,12 +107,12 @@ class RecoverAccountSeedPhrase extends Component {
103107
this.setState({ recoveringAccount: true });
104108
await recoverAccountSeedPhrase(seedPhrase);
105109
await refreshAccount();
106-
}, (e) => {
107-
108-
if (IMPORT_ZERO_BALANCE_ACCOUNT) {
109-
if (e.message.includes('Cannot find matching public key')) {
110-
this.setState({ showCouldNotFindAccountModal: true });
111-
}
110+
}, async (e) => {
111+
if (e.message.includes('Cannot find matching public key')) {
112+
await importZeroBalanceAccountPhrase(seedPhrase);
113+
setZeroBalanceAccountImportMethod('phrase');
114+
clearGlobalAlert();
115+
redirectToApp();
112116
}
113117

114118
throw e;
@@ -141,8 +145,6 @@ class RecoverAccountSeedPhrase extends Component {
141145
isLegit: this.isLegit && !(this.props.localAlert && this.props.localAlert.success === false)
142146
};
143147

144-
const { showCouldNotFindAccountModal, seedPhrase } = this.state;
145-
146148
return (
147149
<StyledContainer className='small-centered border'>
148150
<h1><Translate id='recoverSeedPhrase.pageTitle' /></h1>
@@ -153,13 +155,6 @@ class RecoverAccountSeedPhrase extends Component {
153155
handleChange={this.handleChange}
154156
/>
155157
</form>
156-
{showCouldNotFindAccountModal && (
157-
<CouldNotFindAccountModalWrapper
158-
onClose={() => this.setState({ showCouldNotFindAccountModal: false })}
159-
isOpen={showCouldNotFindAccountModal}
160-
seedPhrase={seedPhrase}
161-
/>
162-
)}
163158
</StyledContainer>
164159
);
165160
}
@@ -172,7 +167,9 @@ const mapDispatchToProps = {
172167
refreshAccount,
173168
clearLocalAlert,
174169
clearAccountState,
175-
showCustomAlert
170+
showCustomAlert,
171+
importZeroBalanceAccountPhrase,
172+
setZeroBalanceAccountImportMethod
176173
};
177174

178175
const mapStateToProps = (state, { match }) => ({

0 commit comments

Comments
 (0)