From 26baaf16556fb7f1faa9d9807d1ef106995cdda0 Mon Sep 17 00:00:00 2001 From: lserra-iov Date: Wed, 4 Dec 2024 15:49:31 -0300 Subject: [PATCH] Add message for the quote not found scenario --- src/common/types/store.ts | 1 + src/status/store/actions.ts | 2 +- src/status/views/Status.vue | 20 ++++++++++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/common/types/store.ts b/src/common/types/store.ts index 5a6f6f41..b1fbe09e 100644 --- a/src/common/types/store.ts +++ b/src/common/types/store.ts @@ -97,6 +97,7 @@ export enum TxStatusType { INVALID_DATA = 'INVALID_DATA', UNEXPECTED_ERROR = 'UNEXPECTED_ERROR', UNSET_STATUS = 'UNSET_STATUS', + NOT_FOUND = 'NOT_FOUND', } export interface TxStatus { diff --git a/src/status/store/actions.ts b/src/status/store/actions.ts index b124a9f5..bd1b2c4b 100644 --- a/src/status/store/actions.ts +++ b/src/status/store/actions.ts @@ -96,7 +96,7 @@ export const actions: ActionTree = { status = await rootState.flyoverPegout?.flyoverService.getPegoutStatus(quoteHash); } } catch (e) { - status = 'NOT_FOUND'; + status = TxStatusType.NOT_FOUND; } finally { commit(constants.STATUS_SET_FLYOVER_STATUS, status); } diff --git a/src/status/views/Status.vue b/src/status/views/Status.vue index 61c7f94c..492794ac 100644 --- a/src/status/views/Status.vue +++ b/src/status/views/Status.vue @@ -26,7 +26,7 @@ :txNotFound="txNotFound" :txWithError="txWithError" /> - @@ -91,8 +91,17 @@ export default defineComponent({ const showStatus = computed(() => !loading.value); - const txNotFound = computed((): boolean => status.value.type === TxStatusType.INVALID_DATA - || status.value.type === TxStatusType.UNEXPECTED_ERROR); + const invalidData = computed(() => status.value.type === TxStatusType.INVALID_DATA); + const unexpectedError = computed(() => status.value.type === TxStatusType.UNEXPECTED_ERROR); + + const isFlyover = computed((): boolean => status.value.type === TxStatusType.FLYOVER_PEGOUT + || status.value.type === TxStatusType.FLYOVER_PEGIN); + const quoteNotFound = computed(() => isFlyover.value + && status.value.flyoverStatus === TxStatusType.NOT_FOUND); + + const txNotFound = computed((): boolean => invalidData.value + || unexpectedError.value + || quoteNotFound.value); const isRejected = computed(() => status.value.txDetails?.status === 'REJECTED' || txNotFound.value); @@ -118,9 +127,6 @@ export default defineComponent({ const isPegOut = computed((): boolean => status.value.type === TxStatusType.PEGOUT || status.value.type === TxStatusType.FLYOVER_PEGOUT); - const isFlyover = computed((): boolean => status.value.type === TxStatusType.FLYOVER_PEGOUT - || status.value.type === TxStatusType.FLYOVER_PEGIN); - const showTimeLeft = computed((): boolean => { const details = txDetails.value as PegoutStatusDataModel; return status.value.type === TxStatusType.PEGOUT @@ -234,6 +240,8 @@ export default defineComponent({ txNotFound, txWithError, rejectionMsg, + invalidData, + unexpectedError, }; }, });