From eb1654c8f0f3e354bb455f502121f029d439275d Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Fri, 8 Mar 2024 10:42:14 -0800 Subject: [PATCH] remove manage nodes from lightning wallets --- .../screens/settings/connection_sync_page.dart | 16 ++++++++++++---- .../dashboard/dashboard_view_model.dart | 3 +++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/src/screens/settings/connection_sync_page.dart b/lib/src/screens/settings/connection_sync_page.dart index cc04944b3..f906778a0 100644 --- a/lib/src/screens/settings/connection_sync_page.dart +++ b/lib/src/screens/settings/connection_sync_page.dart @@ -89,14 +89,22 @@ class ConnectionSyncPage extends BasePage { }), ], ], - SettingsCellWithArrow( - title: S.current.manage_nodes, - handler: (context) => Navigator.of(context).pushNamed(Routes.manageNodes), + Observer( + builder: (context) { + if (!dashboardViewModel.hasNodes) return const SizedBox(); + return Column( + children: [ + SettingsCellWithArrow( + title: S.current.manage_nodes, + handler: (context) => Navigator.of(context).pushNamed(Routes.manageNodes), + ), + ], + ); + }, ), Observer( builder: (context) { if (!dashboardViewModel.hasPowNodes) return const SizedBox(); - return Column( children: [ SettingsCellWithArrow( diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart index 0f77ebe2f..490124cb1 100644 --- a/lib/view_model/dashboard/dashboard_view_model.dart +++ b/lib/view_model/dashboard/dashboard_view_model.dart @@ -361,6 +361,9 @@ abstract class DashboardViewModelBase with Store { ReactionDisposer? _onMoneroBalanceChangeReaction; + @computed + bool get hasNodes => wallet.type != WalletType.lightning; + @computed bool get hasPowNodes => wallet.type == WalletType.nano || wallet.type == WalletType.banano;