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);
},
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);