refactor(projects): use store.loading instead of async component
This commit is contained in:
@@ -12,7 +12,7 @@ const [backgroundImage, visitDisabledImage] = useImages(
|
|||||||
useRender((ctx) => {
|
useRender((ctx) => {
|
||||||
ctx.drawImage(backgroundImage!, 0, 0);
|
ctx.drawImage(backgroundImage!, 0, 0);
|
||||||
|
|
||||||
if (store.projects[store.currentProject]!.url === null) {
|
if (store.projects[store.currentProject]?.url === null) {
|
||||||
ctx.drawImage(visitDisabledImage!, 144, 172);
|
ctx.drawImage(visitDisabledImage!, 144, 172);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import Projects from "./Projects.vue";
|
|||||||
|
|
||||||
const store = useProjectsStore();
|
const store = useProjectsStore();
|
||||||
|
|
||||||
store.$reset();
|
onMounted(async () => {
|
||||||
await store.loadProjects();
|
store.$reset();
|
||||||
|
await store.loadProjects();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Background />
|
<Background />
|
||||||
|
|
||||||
<Projects />
|
<Projects v-if="!store.loading" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user