diff --git a/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte b/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte index 8c570c63288..7d6642abe46 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte @@ -32,6 +32,10 @@ const handleStatusDialog = () => { openStatusDialog = !openStatusDialog; }; + + const handleInsufficientFunds = (e: CustomEvent) => { + dispatch('insufficientFunds', e.detail); + }; diff --git a/packages/bridge-ui-v2/src/components/Transactions/Status.svelte b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte index ae663dabf39..2c49c45bb89 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Status.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte @@ -31,11 +31,10 @@ import { network } from '$stores/network'; import { pendingTransactions } from '$stores/pendingTransactions'; - import InsufficientFunds from './InsufficientFunds.svelte'; + export let bridgeTx: BridgeTransaction; const log = getLogger('components:Status'); - - export let bridgeTx: BridgeTransaction; + const dispatch = createEventDispatcher(); const log = getLogger('components:Status'); const dispatch = createEventDispatcher(); @@ -46,10 +45,12 @@ let processable = false; // bridge tx state to be processed: claimed/retried/released let bridgeTxStatus: Maybe; - let modalOpen = false; + enum LoadingState { + CLAIMING = 'claiming', + RELEASING = 'releasing', + } - // TODO: enum? - let loading: 'claiming' | 'releasing' | false = false; + let loading: LoadingState | false = false; function onProcessable(isTxProcessable: boolean) { processable = isTxProcessable; @@ -143,7 +144,7 @@ warningToast($t('transactions.actions.claim.rejected')); break; case err instanceof InsufficientBalanceError: - modalOpen = true; + dispatch('insufficientFunds', { tx: bridgeTx }); break; case err instanceof InvalidProofError: errorToast($t('TODO: InvalidProofError')); @@ -269,7 +270,7 @@
{#if !processable} - {$t('transactions.status.initiated.name')} + {$t('transactions.status.processing.name')} {:else if loading}
@@ -296,5 +297,3 @@ {$t('transactions.status.error.name')} {/if}
- - diff --git a/packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte b/packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte index 4700a2f9329..918fa36250c 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/StatusInfoDialog.svelte @@ -60,8 +60,8 @@

{$t('transactions.status.dialog.description')} -

{$t('transactions.status.initiated.name')}

- {$t('transactions.status.initiated.description')} +

{$t('transactions.status.processing.name')}

+ {$t('transactions.status.processing.description')}

{$t('transactions.status.claim.name')}

{$t('transactions.status.claim.description')}

{$t('transactions.status.claimed.name')}