diff --git a/packages/desktop/components/modals/AccountActionsMenu.svelte b/packages/desktop/components/modals/AccountActionsMenu.svelte index ec9fef8c294..b3199b6ab3b 100644 --- a/packages/desktop/components/modals/AccountActionsMenu.svelte +++ b/packages/desktop/components/modals/AccountActionsMenu.svelte @@ -3,11 +3,15 @@ import { selectedAccount } from '@core/account/stores' import { localize } from '@core/i18n' - import { activeAccounts, visibleActiveAccounts } from '@core/profile/stores' + import { activeAccounts, isActiveLedgerProfile, visibleActiveAccounts } from '@core/profile/stores' import { deleteAccount } from '@core/profile-manager/actions' import { Icon } from '@auxiliary/icon/enums' import { openPopup, PopupId } from '@auxiliary/popup' + import { profileManager } from '@core/profile-manager' + import { checkOrConnectLedger } from '@core/ledger' + import { showAppNotification } from '@auxiliary/notification' + import { handleError } from '@core/error/handlers' export let modal: Modal = undefined @@ -24,6 +28,29 @@ modal?.close() } + function onVerifyAddressClick(): void { + const ADDRESS_INDEX = 0 + checkOrConnectLedger(() => { + try { + if ($profileManager && $selectedAccount && $isActiveLedgerProfile) { + $profileManager.generateEd25519Address($selectedAccount.index, ADDRESS_INDEX, { + internal: false, + ledgerNanoPrompt: true, + }) + showAppNotification({ + type: 'info', + message: localize('general.verifyLedgerDepositAddress'), + }) + } + } catch (err) { + handleError(err) + } finally { + modal?.close() + } + return Promise.resolve() + }) + } + function onDeleteAccountClick(): void { openPopup({ id: PopupId.DeleteAccount, @@ -40,6 +67,13 @@ + {#if $isActiveLedgerProfile} + + {/if}
{#if showDeleteAccount} diff --git a/packages/shared/locales/en.json b/packages/shared/locales/en.json index 3c412b37db0..c63000e7a5d 100644 --- a/packages/shared/locales/en.json +++ b/packages/shared/locales/en.json @@ -1338,6 +1338,7 @@ "viewDownloads" : "View downloads", "viewStatus": "View status", "viewBalanceBreakdown": "View balance breakdown", + "verifyDepositAddress": "Verify deposit address", "showHiddenAccounts": "Show hidden wallets", "confirm": "Confirm", "hideNetworkStatistics": "Hide network statistics", @@ -1664,7 +1665,8 @@ "jwt": "JSON web token", "internalTransaction": "Internal transaction", "coinType":"Coin type", - "custom": "Custom" + "custom": "Custom", + "verifyLedgerDepositAddress": "Please check the ledger device and verify that the deposit address matches the one displayed on the ledger device" }, "filters":{ "title": "Filters",