Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/src/screens/dashboard/widgets/menu_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class MenuWidgetState extends State<MenuWidget> {
if (!widget.dashboardViewModel.hasMweb) {
items.removeWhere((element) => element.name(context) == S.of(context).litecoin_mweb_settings);
}
if (!widget.dashboardViewModel.isEVM) {
items.removeWhere((element) => element.name(context) == S.of(context).walletConnect);
}
int itemCount = items.length;

moneroIcon = Image.asset('assets/images/crypto/monero.webp');
Expand Down
10 changes: 10 additions & 0 deletions lib/src/widgets/setting_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SettingActions {
walletSettingAction,
addressBookSettingAction,
silentPaymentsSettingAction,
walletConnectSettingsAction,
if (Platform.isIOS || Platform.isAndroid) litecoinMwebSettingAction,
if (Platform.isIOS || Platform.isAndroid) exportOutputsAction,
securityBackupSettingAction,
Expand All @@ -31,6 +32,15 @@ class SettingActions {
supportSettingAction,
];

static SettingActions walletConnectSettingsAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_wallet_connect_settings_button_key'),
name: (context) => S.of(context).walletConnect,
image: 'assets/images/walletconnect_logo.png',
onTap: (BuildContext context) {
Navigator.of(context).pushNamed(Routes.walletConnectConnectionsListing);
},
);

static SettingActions silentPaymentsSettingAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_silent_payment_settings_button_key'),
name: (context) => S.of(context).silent_payments_settings,
Expand Down
4 changes: 4 additions & 0 deletions lib/view_model/dashboard/dashboard_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ abstract class DashboardViewModelBase with Store {
return errors;
}

@computed
bool get
isEVM => (wallet.type == WalletType.ethereum) || (wallet.type == WalletType.solana) || (wallet.type == WalletType.polygon);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an available function that handles this that you can plug in.

isWalletConnectCompatibleChain, its located in lib/reactions/wallet_connect.dart

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh haha thanks David :)

@computed
bool get hasSilentPayments =>
wallet.type == WalletType.bitcoin &&
Expand Down
Loading