Skip to content

Commit

Permalink
fix: IOS recovery info found when installing - fix
Browse files Browse the repository at this point in the history
  • Loading branch information
juanky201271 committed Jun 19, 2024
1 parent e099816 commit 8986042
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/LoadingApp/LoadingApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,10 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, AppStateLoa
//console.log('Loading new wallet', this.state.screen, this.state.walletExists);
// if no wallet file & basic mode -> create a new wallet & go directly to history screen.
if (this.state.mode === ModeEnum.basic) {
// but first we need to check if exists some seed stored in the device from a prior installation
// of Zingo.
// but first we need to check if exists some seed stored in the device from a previous installation
if (this.state.hasRecoveryWalletInfoSaved) {
this.recoverRecoveryWalletInfo(false);
await SettingsFileImpl.writeSettings(SettingsNameEnum.basicFirstViewSeed, true);
await SettingsFileImpl.writeSettings(SettingsNameEnum.basicFirstViewSeed, false);
this.setState({
screen: 1,
walletExists: false,
Expand All @@ -544,7 +543,8 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, AppStateLoa
// setting the prop basicFirstViewSeed to false.
// this means when the user have funds, the seed screen will show up.
await SettingsFileImpl.writeSettings(SettingsNameEnum.basicFirstViewSeed, false);
this.createNewWallet();
// do not go to seed screen
this.createNewWallet(false);
this.setState({ actionButtonsDisabled: false });
this.navigateToLoadedApp();
//console.log('navigate to LoadedApp');
Expand Down Expand Up @@ -783,7 +783,7 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, AppStateLoa
});
};

createNewWallet = () => {
createNewWallet = (goSeedScreen: boolean = true) => {
this.setState({ actionButtonsDisabled: true });
setTimeout(async () => {
let seed: string = await RPCModule.createNewWallet(this.state.server.uri, this.state.server.chain_name);
Expand Down Expand Up @@ -812,7 +812,7 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, AppStateLoa
// basic mode -> same screen.
this.setState(state => ({
wallet,
screen: state.mode === ModeEnum.basic ? state.screen : 2,
screen: goSeedScreen ? 2 : state.screen,
actionButtonsDisabled: false,
walletExists: true,
}));
Expand Down Expand Up @@ -904,6 +904,8 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, AppStateLoa
await createUpdateRecoveryWalletInfo(wallet, this.props.translate);
}
}
// when restore a wallet never the user needs that the seed screen shows up with the first funds received.
await SettingsFileImpl.writeSettings(SettingsNameEnum.basicFirstViewSeed, true);
this.setState({
actionButtonsDisabled: false,
readOnly: type === RestoreFromTypeEnum.seedRestoreFrom ? false : true,
Expand Down

0 comments on commit 8986042

Please sign in to comment.