Update useExtendedNavigation.ts

This commit is contained in:
Marcos Rodriguez Velez 2024-03-24 16:43:12 -04:00
parent 7db5c03790
commit cf29590356
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7

View File

@ -68,17 +68,18 @@ export const useExtendedNavigation = (): NavigationProp<ParamListBase> => {
}
const wallet = wallets.find(w => w.getID() === walletID);
if (wallet && !wallet.getUserHasSavedExport()) {
await presentWalletExportReminder()
.then(() => {
wallet.setUserHasSavedExport(true);
saveToDisk().finally(() => proceedWithNavigation());
})
.catch(() => {
originalNavigation.navigate('WalletExportRoot', {
screen: 'WalletExport',
params: { walletID },
});
try {
await presentWalletExportReminder();
wallet.setUserHasSavedExport(true);
await saveToDisk(); // Assuming saveToDisk() returns a Promise.
proceedWithNavigation();
} catch {
originalNavigation.navigate('WalletExportRoot', {
screen: 'WalletExport',
params: { walletID },
});
}
return; // Prevent proceeding with the original navigation if the reminder is shown
}
}