Skip to content

Commit

Permalink
Adjust UI image location on select secure mnemonic file component
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirAbrams committed Oct 20, 2020
1 parent 91b3dd2 commit 1e3a999
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
48 changes: 26 additions & 22 deletions web/src/components/wallet/FileRestore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class WalletFileRestore extends Component<
this.waitForRescan = this.waitForRescan.bind(this);
this.state = {
loading: false
}
};
}

componentDidMount(): void {
Expand All @@ -64,7 +64,7 @@ export class WalletFileRestore extends Component<

private onMnemonic = async (wordlist: string) => {
var self = this;
console.log('onMnemonic');
console.log("onMnemonic");
const wordCount = wordlist.split(" ").length;
if (
wordCount === 12 ||
Expand All @@ -73,7 +73,7 @@ export class WalletFileRestore extends Component<
wordCount === 25
) {
self.props.onRestoreMnemonic(wordlist);
this.setState( { loading: true } );
this.setState({ loading: true });
} else {
var err: DropzoneError = {
title: "Incorrect Word Count",
Expand All @@ -84,24 +84,27 @@ export class WalletFileRestore extends Component<
}
};

private waitForRescan(): | undefined {
private waitForRescan(): undefined {
//TODO: Use redux-saga for these types of actions
console.log('waitForRescan');
console.log("waitForRescan");
var self = this;
while (this.state.loading) {
console.log('waitForRescan loop before sleep');
setTimeout(() =>
{
console.log('waitForRescan loop after sleep');
axios.get("/wallet/defaultaddress", RequestConfig)
console.log("waitForRescan loop before sleep");
setTimeout(() => {
console.log("waitForRescan loop after sleep");
axios
.get("/wallet/defaultaddress", RequestConfig)
.then(function (response) {
console.log('waitForRescan response', response);
self.setState( { loading: false } );
console.log("waitForRescan response", response);
self.setState({ loading: false });
self.props.onComplete();
})
.catch(function (error) {
console.log("waitForRescan execute wallet/defaultaddress [Get] Error: " + error);
});
})
.catch(function (error) {
console.log(
"waitForRescan execute wallet/defaultaddress [Get] Error: " +
error
);
});
}, 5000);
}
return;
Expand Down Expand Up @@ -149,25 +152,26 @@ export class WalletFileRestore extends Component<
onClick={() => this.props.onCancel()}
margin="150px 0 0 -80px"
/>

<Card
width="100%"
align="center"
minHeight="225px"
padding="2em 4em 2em 2em"
>
<Box display="flex" direction="row" margin="0">
<Box width="60px" margin="0">
<SecureFileIcon width="60px" height="60px" />
</Box>
<SecureFileIcon width="60px" height="60px" />
<Box
direction="column"
width="500px"
align="center"
margin="0 auto 0 auto"
>
<H3 margin="0 0 1em 0">
Restore using Secure Restore File{" "}
</H3>
<Box width="60px" margin="0">
<H3 margin="0 0 1em 0">
Restore using Secure Restore File
</H3>
</Box>
<Dropzone
multiple={false}
accept={".psh.json"}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/wallet/Setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class WalletSetup extends Component<WalletViewDispatchProps, WalletSetupS
this.state.setupState === SetupState.RestoreWithSecureFile && (
<WalletFileRestore
onComplete={() => this.props.onComplete()}
onCancel={() => this.props.onCancel()}
onCancel={() => this.setState({ setupState: SetupState.Restore })}
onRestoreMnemonic={(words) => this.props.walletImportMnemonic(words)}
/>
)}
Expand Down

0 comments on commit 1e3a999

Please sign in to comment.