Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 2ae3fa1

Browse files
Modify RestoreWallet (now RestoreSeed) to utilize new seedVerifyIndices and inits.
Correctly initialize the next restore page before navigating to it, display the correct restore seed verify indices and enter the user input into wallet.restoreSeed.
1 parent aca414d commit 2ae3fa1

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/view/restore-wallet.js renamed to src/view/restore-seed.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Header } from '../component/header';
1212
import Card from '../component/card';
1313

1414
//
15-
// Restore Wallet View
15+
// Restore Wallet Seed View
1616
//
1717

1818
const styles = StyleSheet.create({
@@ -32,38 +32,39 @@ const styles = StyleSheet.create({
3232
},
3333
});
3434

35-
const RestoreWalletView = ({ store, nav, wallet }) => (
35+
const RestoreSeedView = ({ store, wallet }) => (
3636
<Background image="purple-gradient-bg">
3737
<Header>
38-
<BackButton onPress={() => nav.goSeed()} />
38+
<BackButton onPress={() => wallet.initPrevRestorePage()} />
3939
<Button disabled onPress={() => {}} />
4040
</Header>
4141
<MainContent style={styles.content}>
4242
<View>
4343
<H1Text style={styles.title}>Restore your wallet</H1Text>
4444
</View>
4545
<Card style={styles.card}>
46-
<FormSubText>{store.seedVerifyCopy}</FormSubText>
47-
{store.seedVerifyIndexes.map((seedIndex, i) => (
46+
<FormSubText>{store.restoreVerifyCopy}</FormSubText>
47+
{store.restoreVerifyIndexes.map((seedIndex, i) => (
4848
<SeedEntry
4949
seedIndex={seedIndex}
50-
value={store.wallet.seedVerify[i]}
51-
onChangeText={word => wallet.setSeedVerify({ word, index: i })}
50+
value={store.wallet.restoreSeed[seedIndex - 1]}
51+
onChangeText={word =>
52+
wallet.setRestoreSeed({ word, index: seedIndex - 1 })
53+
}
5254
key={i}
5355
autoFocus={i === 0}
54-
onSubmitEditing={() => wallet.checkSeed()}
56+
onSubmitEditing={() => wallet.initNextRestorePage()}
5557
/>
5658
))}
5759
</Card>
58-
<GlasButton onPress={() => wallet.checkSeed()}>Next</GlasButton>
60+
<GlasButton onPress={() => wallet.initNextRestorePage()}>Next</GlasButton>
5961
</MainContent>
6062
</Background>
6163
);
6264

63-
RestoreWalletView.propTypes = {
65+
RestoreSeedView.propTypes = {
6466
store: PropTypes.object.isRequired,
65-
nav: PropTypes.object.isRequired,
6667
wallet: PropTypes.object.isRequired,
6768
};
6869

69-
export default observer(RestoreWalletView);
70+
export default observer(RestoreSeedView);

0 commit comments

Comments
 (0)