Update all to useUSer composabe. Still some bugs to resolve.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useViemStore } from "@/store/viem";
|
||||
import { useUser } from "@/composables/useUser";
|
||||
import ListingComponent from "@/components/ListingComponent/ListingComponent.vue";
|
||||
import LoadingComponent from "@/components/LoadingComponent/LoadingComponent.vue";
|
||||
import CustomAlert from "@/components/CustomAlert/CustomAlert.vue";
|
||||
@@ -14,10 +14,9 @@ import type { ValidDeposit } from "@/model/ValidDeposit";
|
||||
import type { WalletTransaction } from "@/model/WalletTransaction";
|
||||
|
||||
import router from "@/router/index";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
const viemStore = useViemStore();
|
||||
const { walletAddress, networkName, selectedToken } = storeToRefs(viemStore);
|
||||
const user = useUser();
|
||||
const { walletAddress, networkName, selectedToken } = user;
|
||||
const loadingWithdraw = ref<boolean>(false);
|
||||
const showAlert = ref<boolean>(false);
|
||||
|
||||
@@ -47,7 +46,7 @@ const callWithdraw = async (amount: string) => {
|
||||
};
|
||||
|
||||
const getWalletTransactions = async () => {
|
||||
viemStore.setLoadingWalletTransactions(true);
|
||||
user.setLoadingWalletTransactions(true);
|
||||
if (walletAddress.value) {
|
||||
console.log("Will fetch all required data...");
|
||||
const walletDeposits = await listValidDepositTransactionsByWalletAddress(
|
||||
@@ -70,7 +69,7 @@ const getWalletTransactions = async () => {
|
||||
transactionsList.value = allUserTransactions;
|
||||
}
|
||||
}
|
||||
viemStore.setLoadingWalletTransactions(false);
|
||||
user.setLoadingWalletTransactions(false);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
Reference in New Issue
Block a user