Update DepositsHistory page behavior
This commit is contained in:
parent
34ffcc2860
commit
0e8ca7f803
@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useEtherStore } from "@/store/ether";
|
import { useEtherStore } from "@/store/ether";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { ref } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import ListingComponent from "@/components/ListingComponent.vue";
|
import ListingComponent from "@/components/ListingComponent.vue";
|
||||||
import blockchain from "../utils/blockchain";
|
import blockchain from "../utils/blockchain";
|
||||||
|
|
||||||
@ -9,29 +9,28 @@ const etherStore = useEtherStore();
|
|||||||
const { walletAddress } = storeToRefs(etherStore);
|
const { walletAddress } = storeToRefs(etherStore);
|
||||||
const allUserTransactions = ref<any[]>([]);
|
const allUserTransactions = ref<any[]>([]);
|
||||||
|
|
||||||
if (walletAddress.value != "") {
|
watch(walletAddress, async (newValue) => {
|
||||||
blockchain
|
await blockchain
|
||||||
.listAllTransactionByWalletAddress(walletAddress.value)
|
.listAllTransactionByWalletAddress(newValue)
|
||||||
.then((res) => {
|
.then((res) => (allUserTransactions.value = res));
|
||||||
allUserTransactions.value = res;
|
});
|
||||||
|
|
||||||
|
watch(walletAddress, async (newValue) => {
|
||||||
|
console.log(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(allUserTransactions, (newValue) => {
|
||||||
|
console.log(newValue);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="header">Histórico de Depósitos</div>
|
<div class="header">Histórico de Depósitos</div>
|
||||||
<ListingComponent
|
<ListingComponent
|
||||||
v-if="walletAddress != '' && allUserTransactions.length != 0"
|
|
||||||
:wallet-transactions="allUserTransactions"
|
:wallet-transactions="allUserTransactions"
|
||||||
:is-manage-mode="false"
|
:is-manage-mode="false"
|
||||||
></ListingComponent>
|
></ListingComponent>
|
||||||
<div v-if="walletAddress == ''">
|
|
||||||
Conecte sua carteira para ver o histórico
|
|
||||||
</div>
|
|
||||||
<div v-if="allUserTransactions.length == 0 && walletAddress != ''">
|
|
||||||
Carregando dados...
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user