mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
CW-1143-Fix-Ledger-wallets-getting-corruption-popups (#2447)
* fix: handle errors differently if it is a ledger wallet * fix: improve ledger error code regex
This commit is contained in:
@@ -74,7 +74,7 @@ class WalletLoadingService {
|
||||
} catch (error, stack) {
|
||||
await ExceptionHandler.resetLastPopupDate();
|
||||
final isLedgerError = await ExceptionHandler.isLedgerError(error);
|
||||
if (isLedgerError) rethrow;
|
||||
if (isLedgerError || requireHardwareWalletConnection(type, name)) rethrow;
|
||||
await ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
|
||||
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ abstract class LedgerViewModelBase with Store {
|
||||
return error;
|
||||
}
|
||||
|
||||
var errorRegex = RegExp(r'0x\S*?(?= )').firstMatch(error.toString());
|
||||
var errorRegex = RegExp(r'(?:0x\S*?|[0-9a-f]{4})(?= )').firstMatch(error.toString());
|
||||
|
||||
String errorCode = errorRegex?.group(0).toString().replaceAll("0x", "") ?? "";
|
||||
if (errorCode.contains("6985")) {
|
||||
|
||||
Reference in New Issue
Block a user