From 01ef99e65091a8a2ced14264ef2de5826412eeff Mon Sep 17 00:00:00 2001 From: soaresa <10797037+soaresa@users.noreply.github.com> Date: Thu, 23 May 2024 04:51:59 -0300 Subject: [PATCH] Disable Watch-Only Accounts from Transfer Screen (#302) * forbid watch only account access to transfer screen sort dropdown accounts lists * lint fix --- src-tauri/src/commands/wallets.rs | 2 +- src/components/Nav.svelte | 13 +++---------- src/components/wallet/AccountNote.svelte | 2 -- src/components/wallet/AccountSwitcher.svelte | 7 +++++-- src/components/wallet/AccountsList.svelte | 4 +++- src/modules/accountActions.ts | 19 ++----------------- 6 files changed, 14 insertions(+), 33 deletions(-) diff --git a/src-tauri/src/commands/wallets.rs b/src-tauri/src/commands/wallets.rs index e26981cb..629933d3 100644 --- a/src-tauri/src/commands/wallets.rs +++ b/src-tauri/src/commands/wallets.rs @@ -317,7 +317,7 @@ pub async fn switch_profile(account: AccountAddress) -> Result = vec![profile.into()]; diff --git a/src/components/Nav.svelte b/src/components/Nav.svelte index 112efd98..a0c129b3 100644 --- a/src/components/Nav.svelte +++ b/src/components/Nav.svelte @@ -20,6 +20,8 @@ ] const location_store = useLocation() + + $: watchOnly = $signingAccount?.watch_only
@@ -36,20 +38,12 @@
  • {$_('nav.wallet')}
  • -
  • - {$_('nav.transactions')} + {$_('nav.transactions')}
  • - - - - {/if} -
    • @@ -57,6 +51,5 @@
    -
    diff --git a/src/components/wallet/AccountNote.svelte b/src/components/wallet/AccountNote.svelte index b94855e3..4b9491ae 100644 --- a/src/components/wallet/AccountNote.svelte +++ b/src/components/wallet/AccountNote.svelte @@ -4,8 +4,6 @@ export let signingAccount - $signingAccount.note && console.log('>>> signingAccount.note', $signingAccount.note) - async function updateNote() { associateNoteWithAccount($signingAccount.account, $signingAccount.note) } diff --git a/src/components/wallet/AccountSwitcher.svelte b/src/components/wallet/AccountSwitcher.svelte index 58f9df7f..ac22d892 100644 --- a/src/components/wallet/AccountSwitcher.svelte +++ b/src/components/wallet/AccountSwitcher.svelte @@ -1,6 +1,6 @@