feat(gallery): fix router back navigation from gallery and unlock achievements after visiting instead of before
This commit is contained in:
@@ -132,8 +132,6 @@ const animateIntro = async () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const galleryStore = useGalleryStore();
|
|
||||||
|
|
||||||
const animateOutro = async () => {
|
const animateOutro = async () => {
|
||||||
isAnimating.value = true;
|
isAnimating.value = true;
|
||||||
|
|
||||||
@@ -157,7 +155,6 @@ const animateOutro = async () => {
|
|||||||
typeText(descriptionText, description.value, DESCRIPTION_DURATION, true, {
|
typeText(descriptionText, description.value, DESCRIPTION_DURATION, true, {
|
||||||
onComplete: async () => {
|
onComplete: async () => {
|
||||||
await promiseTimeout(ANIMATION_SLEEP * 1000);
|
await promiseTimeout(ANIMATION_SLEEP * 1000);
|
||||||
galleryStore.shouldAnimateOutro = true;
|
|
||||||
router.push("/");
|
router.push("/");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export const useAppStore = defineStore("app", {
|
|||||||
settings,
|
settings,
|
||||||
previousScreen: "home" as AppScreen,
|
previousScreen: "home" as AppScreen,
|
||||||
screen: "home" as AppScreen,
|
screen: "home" as AppScreen,
|
||||||
|
visitedGallery: false,
|
||||||
camera: null as THREE.Camera | null,
|
camera: null as THREE.Camera | null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -76,7 +77,7 @@ export const useAppStore = defineStore("app", {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "gallery":
|
case "gallery":
|
||||||
achievements.unlock("gallery_visit");
|
this.visitedGallery = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "contact":
|
case "contact":
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ export const useGalleryStore = defineStore("gallery", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.shouldAnimateOutro = true;
|
||||||
navigateTo("/gallery");
|
navigateTo("/gallery");
|
||||||
}, ANIMATION.NAVIGATE_DELAY);
|
}, ANIMATION.NAVIGATE_DELAY);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ export const useHomeStore = defineStore("home", {
|
|||||||
this.$reset();
|
this.$reset();
|
||||||
this.selectedButton = selectedButton;
|
this.selectedButton = selectedButton;
|
||||||
this.animateIntro();
|
this.animateIntro();
|
||||||
|
|
||||||
|
if (app.visitedGallery) {
|
||||||
|
app.visitedGallery = false;
|
||||||
|
const achievements = useAchievementsStore();
|
||||||
|
achievements.unlock("gallery_visit");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
animateIntro() {
|
animateIntro() {
|
||||||
|
|||||||
Reference in New Issue
Block a user