re-add tron nodes for existing users

This commit is contained in:
OmarHatem 2024-09-26 01:22:40 +03:00
parent fc7bea6830
commit ea0ba163de
2 changed files with 5 additions and 2 deletions

View file

@ -249,6 +249,9 @@ Future<void> defaultSettingsMigration(
case 40:
await removeMoneroWorld(sharedPreferences: sharedPreferences, nodes: nodes);
break;
case 41:
await addTronNodeList(nodes: nodes);
await replaceTronDefaultNode(sharedPreferences: sharedPreferences, nodes: nodes);
default:
break;
}
@ -1217,7 +1220,7 @@ Future<void> changeSolanaCurrentNodeToDefault(
Future<void> addTronNodeList({required Box<Node> nodes}) async {
final nodeList = await loadDefaultTronNodes();
for (var node in nodeList) {
if (nodes.values.firstWhereOrNull((element) => element.uriRaw == node.uriRaw) == null) {
if (!nodes.values.any((element) => element.uriRaw == node.uriRaw)) {
await nodes.add(node);
}
}

View file

@ -187,7 +187,7 @@ Future<void> initializeAppConfigs() async {
transactionDescriptions: transactionDescriptions,
secureStorage: secureStorage,
anonpayInvoiceInfo: anonpayInvoiceInfo,
initialMigrationVersion: 40,
initialMigrationVersion: 41,
);
}