mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
type handling
hack not fix (model is fix)
This commit is contained in:
parent
47e63cca68
commit
6f27184619
1 changed files with 5 additions and 2 deletions
|
@ -1040,14 +1040,17 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
await _secureStore.read(key: '${_walletId}_epicboxConfig');
|
||||
|
||||
if (storedConfig == null) {
|
||||
storedConfig = DefaultNodes.defaultEpicBoxConfig;
|
||||
storedConfig = json.encode(DefaultNodes.defaultEpicBoxConfig);
|
||||
} else {
|
||||
dynamic decoded = json.decode(storedConfig!);
|
||||
if (decoded is String) { // we should make a model instead
|
||||
decoded = json.decode(storedConfig!);
|
||||
}
|
||||
final domain = decoded["domain"] ?? "empty";
|
||||
if (domain != "empty") {
|
||||
//If we have the old invalid config, use the new default one
|
||||
// new storage format stores domain under "epicbox_domain", old storage format used "domain"
|
||||
storedConfig = DefaultNodes.defaultEpicBoxConfig;
|
||||
storedConfig = json.encode(DefaultNodes.defaultEpicBoxConfig);
|
||||
}
|
||||
}
|
||||
final decoded = json.decode(storedConfig);
|
||||
|
|
Loading…
Reference in a new issue