Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix retry button visibility #1254

Merged
merged 5 commits into from
Dec 27, 2023
Merged
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
31 changes: 13 additions & 18 deletions src/views/BridgeTransaction.vue
Original file line number Diff line number Diff line change
@@ -97,10 +97,10 @@
:fiat-value="txExternalTransferFeeFiatValue"
/>

<div v-if="txSoraHash" class="transaction-hash-container transaction-hash-container--with-dropdown">
<div v-if="txInternalHash" class="transaction-hash-container transaction-hash-container--with-dropdown">
<s-input
:placeholder="getNetworkText('bridgeTransaction.transactionHash')"
:value="txSoraHashFormatted"
:value="txInternalHashFormatted"
readonly
/>
<s-button
@@ -109,7 +109,7 @@
alternative
icon="basic-copy-24"
:tooltip="hashCopyTooltip"
@click="handleCopyAddress(txSoraHash, $event)"
@click="handleCopyAddress(txInternalHash, $event)"
/>
<bridge-links-dropdown v-if="soraExplorerLinks.length" :links="soraExplorerLinks" />
</div>
@@ -176,7 +176,7 @@
{{ t('exceededAmountText', { amount: t('minAmountText') }) }}
</template>
<template v-else-if="isTxWaiting">{{ t('confirmTransactionText') }}</template>
<template v-else-if="isTxFailed && isRetryAvailable">{{ t('retryText') }}</template>
<template v-else-if="isTxFailed && txIsUnsigned">{{ t('retryText') }}</template>
</s-button>

<div v-if="txWaitingForApprove" class="transaction-approval-text">
@@ -370,13 +370,15 @@ export default class BridgeTransaction extends Mixins(
}

get txSoraHash(): string {
// don't use Sora blockId in incoming direction
const blockId = this.isOutgoing ? this.txSoraBlockId : '';
return this.historyItem?.hash ?? blockId;
return this.historyItem?.hash ?? '';
}

get txSoraHashFormatted(): string {
return this.formatAddress(this.txSoraHash, FORMATTED_HASH_LENGTH);
get txInternalHash(): string {
return this.txSoraHash || this.txSoraBlockId || this.txSoraId;
}

get txInternalHashFormatted(): string {
return this.formatAddress(this.txInternalHash, FORMATTED_HASH_LENGTH);
}

get txExternalBlockId(): string {
@@ -430,7 +432,7 @@ export default class BridgeTransaction extends Mixins(
}

get txIsFinilized(): boolean {
return this.isTxCompleted || (this.isTxFailed && !this.isRetryAvailable);
return !this.isTxPending && !this.isTxWaiting && !this.txIsUnsigned;
}

get headerIconClasses(): string {
@@ -451,7 +453,7 @@ export default class BridgeTransaction extends Mixins(
}

get transactionStatus(): string {
if (this.isTxWaiting) {
if (this.txIsUnsigned || this.isTxWaiting) {
return this.t('bridgeTransaction.statuses.waitingForConfirmation');
}
if (this.isTxFailed) {
@@ -460,9 +462,6 @@ export default class BridgeTransaction extends Mixins(
if (this.isTxCompleted) {
return this.t('bridgeTransaction.statuses.done');
}
if (!this.txId) {
return this.t('bridgeTransaction.statuses.waitingForConfirmation');
}

return this.t('bridgeTransaction.statuses.pending') + '...';
}
@@ -517,10 +516,6 @@ export default class BridgeTransaction extends Mixins(
);
}

get isRetryAvailable(): boolean {
return this.txIsUnsigned || this.isEvmTxType;
}

get isAnotherEvmAddress(): boolean {
if (!this.isEvmTxType) return false;