Fix auth guard watcher to use Vue 3 watch instead of $watch
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 19s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 19s
$watch is a Vue 2 instance method not available on Pinia stores. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { createRouter, createWebHistory } from "vue-router";
|
import { createRouter, createWebHistory } from "vue-router";
|
||||||
|
import { watch } from "vue";
|
||||||
import DefaultLayout from "@/layouts/DefaultLayout.vue";
|
import DefaultLayout from "@/layouts/DefaultLayout.vue";
|
||||||
import CVLayout from "@/layouts/CVLayout.vue";
|
import CVLayout from "@/layouts/CVLayout.vue";
|
||||||
import Landing from "@/views/landing/Landing.vue";
|
import Landing from "@/views/landing/Landing.vue";
|
||||||
@@ -95,7 +96,7 @@ router.beforeEach(async (to) => {
|
|||||||
const homeData = useHomeDataStore();
|
const homeData = useHomeDataStore();
|
||||||
if (!homeData.loaded) {
|
if (!homeData.loaded) {
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
const stop = homeData.$watch("loaded", (val) => {
|
const stop = watch(() => homeData.loaded, (val) => {
|
||||||
if (val) { stop(); resolve(); }
|
if (val) { stop(); resolve(); }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user