update profile profile page
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import { useWalletStoreV2 } from "@/stores/walletV2";
|
||||
import { useTokenStore } from "@/stores/tokens";
|
||||
import { useContractStore } from "@/stores/contracts";
|
||||
import { useMemeburnerStore } from "@/stores/memeburner";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useMultiCallStore } from "@/stores/multicall";
|
||||
import { useRoundsStore } from "@/stores/rounds";
|
||||
|
||||
import {
|
||||
getAccount,
|
||||
} from "@wagmi/core";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -27,7 +38,38 @@ const router = createRouter({
|
||||
name: "Wagmi",
|
||||
component: () => import("../views/WagmiView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/profile",
|
||||
name: "Profile",
|
||||
component: () => import("../views/ProfileView.vue"),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
router.beforeEach(async (to, from) => {
|
||||
//init
|
||||
const tokenStore = useTokenStore();
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
const rewardLockerStore = useRewardLockerStore();
|
||||
const roundsStore = useRoundsStore();
|
||||
const walletStore = useWalletStoreV2();
|
||||
|
||||
if (!walletStore.publicClient) {
|
||||
await walletStore.init();
|
||||
await tokenStore.initV2();
|
||||
await memeBurnerStore.init();
|
||||
await rewardLockerStore.init();
|
||||
await memeBurnerStore.init();
|
||||
|
||||
|
||||
if (!roundsStore.currentRound) {
|
||||
roundsStore.currentRound = parseInt(await memeBurnerStore.getCurrentRound());
|
||||
console.log("roundsStore.currentRound", roundsStore.currentRound);
|
||||
roundsStore.activeRound = roundsStore.currentRound;
|
||||
}
|
||||
}
|
||||
// initContracts
|
||||
return true;
|
||||
});
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user