Update all to useUSer composabe. Still some bugs to resolve.

This commit is contained in:
Filipe Soccol
2025-04-01 12:04:24 -03:00
parent e93cac6086
commit 9fa2b34a5d
26 changed files with 495 additions and 454 deletions

View File

@@ -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 () => {