diff --git a/website/client/components/notifications.vue b/website/client/components/notifications.vue index fe39bb3e58..79bba88cd5 100644 --- a/website/client/components/notifications.vue +++ b/website/client/components/notifications.vue @@ -317,18 +317,12 @@ export default { this.$store.dispatch('user:fetch'), this.$store.dispatch('tasks:fetchUserTasks'), ]).then(() => { - this.debounceCheckUserAchievements(); - // @TODO: This is a timeout to ensure dom is loaded window.setTimeout(() => { - this.initTour(); - if (this.user.flags.tour.intro === this.TOUR_END || !this.user.flags.welcomed) return; - this.goto('intro', 0); + this.runForcedModals(); }, 2000); - this.forceVerifyUsername(); - - this.runYesterDailies(); + this.debounceCheckUserAchievements(); // Do not remove the event listener as it's live for the entire app lifetime document.addEventListener('mousemove', this.checkNextCron); @@ -344,6 +338,14 @@ export default { document.removeEventListener('keydown', this.checkNextCron); }, methods: { + runForcedModals () { + if (!this.user.flags.verifiedUsername) return this.$root.$emit('bv::show::modal', 'verify-username'); + + this.initTour(); + if (!(this.user.flags.tour.intro === this.TOUR_END || !this.user.flags.welcomed)) return this.goto('intro', 0); + + return this.runYesterDailies(); + }, showDeathModal () { this.playSound('Death'); this.$root.$emit('bv::show::modal', 'death'); @@ -471,11 +473,6 @@ export default { this.nextCron = Number(nextCron.format('x')); this.$store.state.isRunningYesterdailies = false; }, - forceVerifyUsername () { - if (this.user.flags.verifiedUsername) return; - - this.$root.$emit('bv::show::modal', 'verify-username'); - }, async runYesterDailies () { if (this.$store.state.isRunningYesterdailies) return; this.$store.state.isRunningYesterdailies = true;