Skip to content

Commit

Permalink
Add message for the quote not found scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
lserra-iov committed Dec 4, 2024
1 parent 671e574 commit 26baaf1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/common/types/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/status/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const actions: ActionTree<TxStatus, RootState> = {
status = await rootState.flyoverPegout?.flyoverService.getPegoutStatus(quoteHash);
}
} catch (e) {
status = 'NOT_FOUND';
status = TxStatusType.NOT_FOUND;
} finally {
commit(constants.STATUS_SET_FLYOVER_STATUS, status);
}
Expand Down
20 changes: 14 additions & 6 deletions src/status/views/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
:txNotFound="txNotFound" :txWithError="txWithError" />
<tx-pegout v-if="isPegOut" :txId="txId" :isFlyover="isFlyover"
:txNotFound="txNotFound" :txWithError="txWithError" />
<status-progress-bar class="mt-4" v-if="txNotFound" :isFlyover="isFlyover"
<status-progress-bar v-if="invalidData || unexpectedError" class="mt-4" :isFlyover="isFlyover"
:txNotFound="txNotFound" :txWithError="txWithError" />
</v-row>
<v-row v-else>
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -234,6 +240,8 @@ export default defineComponent({
txNotFound,
txWithError,
rejectionMsg,
invalidData,
unexpectedError,
};
},
});
Expand Down

0 comments on commit 26baaf1

Please sign in to comment.