feat(achievements): implement unlocking, saving and notification
This commit is contained in:
@@ -61,7 +61,11 @@ export const useProjectsStore = defineStore("projects", {
|
||||
|
||||
visitProject() {
|
||||
const link = this.projects[this.currentProject]?.link;
|
||||
if (link) navigateTo(link, { open: { target: "_blank" } });
|
||||
if (link) {
|
||||
navigateTo(link, { open: { target: "_blank" } });
|
||||
const achievements = useAchievementsStore();
|
||||
achievements.unlock("projects_open_link");
|
||||
}
|
||||
},
|
||||
|
||||
scrollProjects(direction: "left" | "right") {
|
||||
@@ -89,6 +93,13 @@ export const useProjectsStore = defineStore("projects", {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (this.currentProject >= 4) {
|
||||
setTimeout(() => {
|
||||
const achievements = useAchievementsStore();
|
||||
achievements.unlock("projects_view_5");
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// TODO: not used anymore
|
||||
|
||||
Reference in New Issue
Block a user