Prevented challenge edit during RYA (#9373)

This commit is contained in:
Keith Holliday
2017-11-02 11:37:29 -06:00
committed by GitHub
parent d98fe79e9c
commit 0e958fd306
3 changed files with 7 additions and 6 deletions

View File

@@ -257,7 +257,7 @@ export default {
this.mp(mana); this.mp(mana);
}, },
userLvl (after, before) { userLvl (after, before) {
if (after <= before || this.isRunningYesterdailies) return; if (after <= before || this.$store.state.isRunningYesterdailies) return;
this.showLevelUpNotifications(after); this.showLevelUpNotifications(after);
}, },
userClassSelect (after) { userClassSelect (after) {
@@ -285,7 +285,6 @@ export default {
this.$root.$emit('show::modal', 'quest-invitation'); this.$root.$emit('show::modal', 'quest-invitation');
}, },
}, },
mounted () { mounted () {
Promise.all([ Promise.all([
this.$store.dispatch('user:fetch'), this.$store.dispatch('user:fetch'),
@@ -345,7 +344,7 @@ export default {
this.$root.$emit('playSound', sound); this.$root.$emit('playSound', sound);
}, },
checkNextCron: throttle(function checkNextCron () { 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([ Promise.all([
this.$store.dispatch('user:fetch', {forceLoad: true}), this.$store.dispatch('user:fetch', {forceLoad: true}),
this.$store.dispatch('tasks:fetchUserTasks', {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 // Setup a listener that executes 10 seconds after the next cron time
this.nextCron = Number(nextCron.format('x')); this.nextCron = Number(nextCron.format('x'));
this.isRunningYesterdailies = false; this.$store.state.isRunningYesterdailies = false;
}, },
async runYesterDailies () { async runYesterDailies () {
if (this.isRunningYesterdailies) return; if (this.$store.state.isRunningYesterdailies) return;
this.isRunningYesterdailies = true; this.$store.state.isRunningYesterdailies = true;
if (!this.user.needsCron) { if (!this.user.needsCron) {
this.handleUserNotifications(this.user.notifications); this.handleUserNotifications(this.user.notifications);

View File

@@ -553,6 +553,7 @@ export default {
} }
}, },
handleBrokenTask (task) { handleBrokenTask (task) {
if (this.$store.state.isRunningYesterdailies) return;
this.$store.state.brokenChallengeTask = task; this.$store.state.brokenChallengeTask = task;
this.$root.$emit('show::modal', 'broken-task-modal'); this.$root.$emit('show::modal', 'broken-task-modal');
}, },

View File

@@ -137,6 +137,7 @@ export default function () {
equipmentDrawerOpen: true, equipmentDrawerOpen: true,
groupPlans: [], groupPlans: [],
groupNotifications: [], groupNotifications: [],
isRunningYesterdailies: false,
}, },
}); });