diff --git a/app/pages/gallery.vue b/app/pages/gallery.vue index 1013747..3188d04 100644 --- a/app/pages/gallery.vue +++ b/app/pages/gallery.vue @@ -132,8 +132,6 @@ const animateIntro = async () => { ); }; -const galleryStore = useGalleryStore(); - const animateOutro = async () => { isAnimating.value = true; @@ -157,7 +155,6 @@ const animateOutro = async () => { typeText(descriptionText, description.value, DESCRIPTION_DURATION, true, { onComplete: async () => { await promiseTimeout(ANIMATION_SLEEP * 1000); - galleryStore.shouldAnimateOutro = true; router.push("/"); }, }); diff --git a/app/stores/app.ts b/app/stores/app.ts index d39e82f..2b950e3 100644 --- a/app/stores/app.ts +++ b/app/stores/app.ts @@ -49,6 +49,7 @@ export const useAppStore = defineStore("app", { settings, previousScreen: "home" as AppScreen, screen: "home" as AppScreen, + visitedGallery: false, camera: null as THREE.Camera | null, }; }, @@ -76,7 +77,7 @@ export const useAppStore = defineStore("app", { break; case "gallery": - achievements.unlock("gallery_visit"); + this.visitedGallery = true; break; case "contact": diff --git a/app/stores/gallery.ts b/app/stores/gallery.ts index 882ce4f..7e0ba85 100644 --- a/app/stores/gallery.ts +++ b/app/stores/gallery.ts @@ -90,6 +90,7 @@ export const useGalleryStore = defineStore("gallery", { } setTimeout(() => { + this.shouldAnimateOutro = true; navigateTo("/gallery"); }, ANIMATION.NAVIGATE_DELAY); }, diff --git a/app/stores/home.ts b/app/stores/home.ts index 0eda6d9..5c06898 100644 --- a/app/stores/home.ts +++ b/app/stores/home.ts @@ -40,6 +40,12 @@ export const useHomeStore = defineStore("home", { this.$reset(); this.selectedButton = selectedButton; this.animateIntro(); + + if (app.visitedGallery) { + app.visitedGallery = false; + const achievements = useAchievementsStore(); + achievements.unlock("gallery_visit"); + } }, animateIntro() {