diff --git a/lib/src/screens/nodes/nodes_list_page.dart b/lib/src/screens/nodes/nodes_list_page.dart index d5383e6ed..de8a76442 100644 --- a/lib/src/screens/nodes/nodes_list_page.dart +++ b/lib/src/screens/nodes/nodes_list_page.dart @@ -50,10 +50,7 @@ class NodeListPage extends BasePage { onPressed: () async { Navigator.pop(context); await nodeList.reset(); - if (nodeList.nodes.isNotEmpty) { - await settings.setCurrentNode( - node: nodeList.nodes[0]); - } + await settings.setCurrentNodeToDefault(); }, child: Text(S.of(context).reset)) ], diff --git a/lib/src/stores/settings/settings_store.dart b/lib/src/stores/settings/settings_store.dart index 4ade305bb..ef6f11236 100644 --- a/lib/src/stores/settings/settings_store.dart +++ b/lib/src/stores/settings/settings_store.dart @@ -11,6 +11,7 @@ import 'package:cake_wallet/src/domain/common/transaction_priority.dart'; import 'package:cake_wallet/src/stores/action_list/action_list_display_mode.dart'; import 'package:cake_wallet/src/screens/settings/items/item_headers.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/src/domain/common/default_settings_migration.dart'; part 'settings_store.g.dart'; @@ -266,4 +267,9 @@ abstract class SettingsStoreBase with Store { ItemHeaders.faq: S.current.faq }); } + + Future setCurrentNodeToDefault() async { + await changeCurrentNodeToDefault(sharedPreferences: _sharedPreferences, nodes: _nodes); + await loadSettings(); + } }