From cf9760bb2168b644a1dd36f6f3140f698c3909ec Mon Sep 17 00:00:00 2001 From: brunoedcf Date: Mon, 13 Feb 2023 19:15:01 -0300 Subject: [PATCH] Pull Request review changes --- .../ListingComponent/ListingComponent.vue | 48 ++++--------------- src/views/ManageBidsView.vue | 5 +- 2 files changed, 9 insertions(+), 44 deletions(-) diff --git a/src/components/ListingComponent/ListingComponent.vue b/src/components/ListingComponent/ListingComponent.vue index 1fc9059..880cc2f 100644 --- a/src/components/ListingComponent/ListingComponent.vue +++ b/src/components/ListingComponent/ListingComponent.vue @@ -9,16 +9,15 @@ import { ref, watch } from "vue"; // props const props = defineProps<{ - depositList: (Event | ValidDeposit)[]; - walletTransactions: (Event | ValidDeposit)[]; - isManageMode: boolean; + depositList: ValidDeposit[]; + walletTransactions: Event[]; }>(); const emit = defineEmits(["depositWithdrawn"]); const etherStore = useEtherStore(); -const itemsToShow = ref<(Event | ValidDeposit)[]>([]); +const itemsToShow = ref([]); const withdrawAmount = ref(""); const callWithdraw = async () => { @@ -34,7 +33,7 @@ const callWithdraw = async () => { const getRemaining = (): number => { if (props.depositList instanceof Array) { - const deposit = props.depositList[0] as ValidDeposit; + const deposit = props.depositList[0]; return deposit ? deposit.remaining : 0; } return 0; @@ -46,13 +45,6 @@ const getExplorer = (): string => { : "Polygonscan"; }; -// Methods -const isValidDeposit = ( - deposit: Event | ValidDeposit -): deposit is ValidDeposit => { - return (deposit as ValidDeposit).token !== undefined; -}; - const showInitialItems = (): void => { itemsToShow.value = props.walletTransactions.slice(0, 3); }; @@ -120,7 +112,7 @@ showInitialItems();

-
+

Valor do saque

- {{ getEventName((item as Event).event) }} + {{ getEventName(item.event) }}

- {{ - isValidDeposit(item) - ? item.remaining - : getAmountFormatted(item.args?.amount) - }} + {{ getAmountFormatted(item.args?.amount) }} BRZ

@@ -170,34 +158,14 @@ showInitialItems(); Finalizado
{{ getExplorer() }} Redirect image
-
([]); -const transactionsList = ref<(Event | ValidDeposit)[]>([]); +const transactionsList = ref([]); const updateRemaining = async () => { const walletDeposits = await listValidDepositTransactionsByWalletAddress( @@ -33,12 +33,10 @@ onMounted(async () => { const walletDeposits = await listValidDepositTransactionsByWalletAddress( walletAddress.value ); - console.log(walletDeposits); const allUserTransactions = await listAllTransactionByWalletAddress( walletAddress.value ); - console.log(allUserTransactions); if (walletDeposits) { depositList.value = walletDeposits; @@ -93,7 +91,6 @@ watch(networkName, async () => {