diff --git a/packages/widget/src/controllers/transfers/fungible-token-transfer.ts b/packages/widget/src/controllers/transfers/fungible-token-transfer.ts index 64657104..5024fb8f 100644 --- a/packages/widget/src/controllers/transfers/fungible-token-transfer.ts +++ b/packages/widget/src/controllers/transfers/fungible-token-transfer.ts @@ -338,18 +338,6 @@ export class FungibleTokenTransferController implements ReactiveController { if (this.transferTransactionId) { return FungibleTransferState.COMPLETED; } - if (this.waitingUserConfirmation) { - return FungibleTransferState.WAITING_USER_CONFIRMATION; - } - if (this.waitingTxExecution) { - return FungibleTransferState.WAITING_TX_EXECUTION; - } - if (this.pendingEvmApprovalTransactions.length > 0) { - return FungibleTransferState.PENDING_APPROVALS; - } - if (this.pendingTransferTransaction) { - return FungibleTransferState.PENDING_TRANSFER; - } if (!this.sourceNetwork) { return FungibleTransferState.MISSING_SOURCE_NETWORK; } @@ -359,11 +347,9 @@ export class FungibleTokenTransferController implements ReactiveController { if (!this.selectedResource) { return FungibleTransferState.MISSING_RESOURCE; } - - if (this.destinationAddress === '') { - return FungibleTransferState.MISSING_DESTINATION_ADDRESS; + if (this.resourceAmount.eq(0)) { + return FungibleTransferState.MISSING_RESOURCE_AMOUNT; } - if ( this.destinationAddress === null || this.destinationAddress === undefined || @@ -371,13 +357,21 @@ export class FungibleTokenTransferController implements ReactiveController { ) { return FungibleTransferState.INVALID_DESTINATION_ADDRESS; } - - if (this.resourceAmount.eq(0)) { - return FungibleTransferState.MISSING_RESOURCE_AMOUNT; - } if (this.destinationAddress === '') { return FungibleTransferState.MISSING_DESTINATION_ADDRESS; } + if (this.waitingUserConfirmation) { + return FungibleTransferState.WAITING_USER_CONFIRMATION; + } + if (this.waitingTxExecution) { + return FungibleTransferState.WAITING_TX_EXECUTION; + } + if (this.pendingEvmApprovalTransactions.length > 0) { + return FungibleTransferState.PENDING_APPROVALS; + } + if (this.pendingTransferTransaction) { + return FungibleTransferState.PENDING_TRANSFER; + } if ( !this.walletContext.value?.evmWallet && !this.walletContext.value?.substrateWallet