From 2a0c06967424d936df35efc2c3624f7b77c592ff Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Thu, 19 Jan 2023 18:43:15 -0300 Subject: [PATCH] Add watch to network when user is on manage bids or transaction history Co-authored-by: brunoedcf --- src/components/ListingComponent.vue | 55 +++++++++++++--------------- src/views/ManageBidsView.vue | 8 +++- src/views/TransactionHistoryView.vue | 18 ++++----- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/components/ListingComponent.vue b/src/components/ListingComponent.vue index 2166135..c58c07c 100644 --- a/src/components/ListingComponent.vue +++ b/src/components/ListingComponent.vue @@ -43,6 +43,18 @@ const loadMore = (): void => { ); }; +const getEventName = (event: string | undefined): string => { + if (!event) return "Desconhecido"; + + const possibleEventName: { [key: string]: string } = { + DepositAdded: "Oferta", + LockAdded: "Compra", + LockReleased: "Reserva", + }; + + return possibleEventName[event]; +}; + // watch props changes watch(props, async (): Promise => { const itemsToShowQty = itemsToShow.value.length; @@ -95,6 +107,19 @@ showInitialItems(); 20 out 2022 + + {{ getEventName((item as Event).event) }} + + +
+ Etherscan + Redirect image +
+
- - {{ "Oferta" }} - - - - {{ "Reserva" }} - - - - {{ "Compra" }} - -
Retirar Cancel image
- -
- Etherscan - Redirect image -
([]); if (walletAddress.value) { @@ -46,6 +46,12 @@ watch(walletAddress, async () => { depositList.value = walletDeposits; } }); + +watch(networkName, async () => { + await listValidDepositTransactionsByWalletAddress(walletAddress.value).then((res) => { + if (res) depositList.value = res; + }); +});