mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
CW-782: Show error report popup without cooldown (#1739)
* improve exception throwing on broken wallets - put _lastOpenedWallet to avoid issues on windows (file is currently open by) - don't throw corruptedWalletsSeed - instead store it inside of secureStorage - await ExceptionHandler.onError calls where possible to makse sure that popup won't be canceled by some UI element - adjust BaseAlertDialog to be scrollable if the text is too long - add ExceptionHandler.resetLastPopupDate - that can be called when we want to show error report screen (bypassing cooldown) * fix: HiveError: Box has already been closed. * await the alerts to be sure that each one of them is being shown fix typo in secure storage * Update lib/core/backup_service.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * address comments on github * don't store seeds in secure storage * fix wallet password * update monero_c update corrupted seeds UI prevent app from crashing when wallet is corrupted * show alert with seeds * Update corrupted wallet UI Fix wallet opening cache * remove unused code --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
d8d4190608
commit
17d34beae9
51 changed files with 205 additions and 87 deletions
|
@ -81,6 +81,7 @@ void createWalletSync(
|
|||
wptr = newWptr;
|
||||
monero.Wallet_store(wptr!, path: path);
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
_lastOpenedWallet = path;
|
||||
|
||||
// is the line below needed?
|
||||
// setupNodeSync(address: "node.moneroworld.com:18089");
|
||||
|
@ -116,6 +117,7 @@ void restoreWalletFromSeedSync(
|
|||
wptr = newWptr;
|
||||
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
_lastOpenedWallet = path;
|
||||
}
|
||||
|
||||
void restoreWalletFromKeysSync(
|
||||
|
@ -183,6 +185,7 @@ void restoreWalletFromKeysSync(
|
|||
wptr = newWptr;
|
||||
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
_lastOpenedWallet = path;
|
||||
}
|
||||
|
||||
void restoreWalletFromSpendKeySync(
|
||||
|
@ -231,6 +234,7 @@ void restoreWalletFromSpendKeySync(
|
|||
storeSync();
|
||||
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
_lastOpenedWallet = path;
|
||||
}
|
||||
|
||||
String _lastOpenedWallet = "";
|
||||
|
@ -260,7 +264,7 @@ Future<void> restoreWalletFromHardwareWallet(
|
|||
throw WalletRestoreFromSeedException(message: error);
|
||||
}
|
||||
wptr = newWptr;
|
||||
|
||||
_lastOpenedWallet = path;
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
}
|
||||
|
||||
|
@ -295,6 +299,11 @@ Future<void> loadWallet(
|
|||
password: password,
|
||||
kdfRounds: 1,
|
||||
);
|
||||
final status = monero.WalletManager_errorString(wmPtr);
|
||||
if (status != "") {
|
||||
print("loadWallet:"+status);
|
||||
throw WalletOpeningException(message: status);
|
||||
}
|
||||
} else {
|
||||
deviceType = 0;
|
||||
}
|
||||
|
@ -314,15 +323,15 @@ Future<void> loadWallet(
|
|||
|
||||
final newWptr = Pointer<Void>.fromAddress(newWptrAddr);
|
||||
|
||||
_lastOpenedWallet = path;
|
||||
final status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
final err = monero.Wallet_errorString(newWptr);
|
||||
print(err);
|
||||
print("loadWallet:"+err);
|
||||
throw WalletOpeningException(message: err);
|
||||
}
|
||||
|
||||
wptr = newWptr;
|
||||
_lastOpenedWallet = path;
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue