diff --git a/website/client/components/notifications.vue b/website/client/components/notifications.vue index a9f32592a6..8426e90cd6 100644 --- a/website/client/components/notifications.vue +++ b/website/client/components/notifications.vue @@ -257,7 +257,7 @@ export default { this.mp(mana); }, userLvl (after, before) { - if (after <= before || this.isRunningYesterdailies) return; + if (after <= before || this.$store.state.isRunningYesterdailies) return; this.showLevelUpNotifications(after); }, userClassSelect (after) { @@ -285,7 +285,6 @@ export default { this.$root.$emit('show::modal', 'quest-invitation'); }, }, - mounted () { Promise.all([ this.$store.dispatch('user:fetch'), @@ -345,7 +344,7 @@ export default { this.$root.$emit('playSound', sound); }, checkNextCron: throttle(function checkNextCron () { - if (!this.isRunningYesterdailies && this.nextCron && Date.now() > this.nextCron) { + if (!this.$store.state.isRunningYesterdailies && this.nextCron && Date.now() > this.nextCron) { Promise.all([ this.$store.dispatch('user:fetch', {forceLoad: true}), this.$store.dispatch('tasks:fetchUserTasks', {forceLoad: true}), @@ -367,11 +366,11 @@ export default { // Setup a listener that executes 10 seconds after the next cron time this.nextCron = Number(nextCron.format('x')); - this.isRunningYesterdailies = false; + this.$store.state.isRunningYesterdailies = false; }, async runYesterDailies () { - if (this.isRunningYesterdailies) return; - this.isRunningYesterdailies = true; + if (this.$store.state.isRunningYesterdailies) return; + this.$store.state.isRunningYesterdailies = true; if (!this.user.needsCron) { this.handleUserNotifications(this.user.notifications); diff --git a/website/client/components/tasks/task.vue b/website/client/components/tasks/task.vue index 466a026509..a417af861d 100644 --- a/website/client/components/tasks/task.vue +++ b/website/client/components/tasks/task.vue @@ -553,6 +553,7 @@ export default { } }, handleBrokenTask (task) { + if (this.$store.state.isRunningYesterdailies) return; this.$store.state.brokenChallengeTask = task; this.$root.$emit('show::modal', 'broken-task-modal'); }, diff --git a/website/client/store/index.js b/website/client/store/index.js index b30c008fd9..8cce97fff7 100644 --- a/website/client/store/index.js +++ b/website/client/store/index.js @@ -137,6 +137,7 @@ export default function () { equipmentDrawerOpen: true, groupPlans: [], groupNotifications: [], + isRunningYesterdailies: false, }, });