mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
fix(modals): better stack???
This commit is contained in:
@@ -317,18 +317,12 @@ export default {
|
|||||||
this.$store.dispatch('user:fetch'),
|
this.$store.dispatch('user:fetch'),
|
||||||
this.$store.dispatch('tasks:fetchUserTasks'),
|
this.$store.dispatch('tasks:fetchUserTasks'),
|
||||||
]).then(() => {
|
]).then(() => {
|
||||||
this.debounceCheckUserAchievements();
|
|
||||||
|
|
||||||
// @TODO: This is a timeout to ensure dom is loaded
|
// @TODO: This is a timeout to ensure dom is loaded
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
this.initTour();
|
this.runForcedModals();
|
||||||
if (this.user.flags.tour.intro === this.TOUR_END || !this.user.flags.welcomed) return;
|
|
||||||
this.goto('intro', 0);
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
this.forceVerifyUsername();
|
this.debounceCheckUserAchievements();
|
||||||
|
|
||||||
this.runYesterDailies();
|
|
||||||
|
|
||||||
// Do not remove the event listener as it's live for the entire app lifetime
|
// Do not remove the event listener as it's live for the entire app lifetime
|
||||||
document.addEventListener('mousemove', this.checkNextCron);
|
document.addEventListener('mousemove', this.checkNextCron);
|
||||||
@@ -344,6 +338,14 @@ export default {
|
|||||||
document.removeEventListener('keydown', this.checkNextCron);
|
document.removeEventListener('keydown', this.checkNextCron);
|
||||||
},
|
},
|
||||||
methods: {
|
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 () {
|
showDeathModal () {
|
||||||
this.playSound('Death');
|
this.playSound('Death');
|
||||||
this.$root.$emit('bv::show::modal', 'death');
|
this.$root.$emit('bv::show::modal', 'death');
|
||||||
@@ -471,11 +473,6 @@ export default {
|
|||||||
this.nextCron = Number(nextCron.format('x'));
|
this.nextCron = Number(nextCron.format('x'));
|
||||||
this.$store.state.isRunningYesterdailies = false;
|
this.$store.state.isRunningYesterdailies = false;
|
||||||
},
|
},
|
||||||
forceVerifyUsername () {
|
|
||||||
if (this.user.flags.verifiedUsername) return;
|
|
||||||
|
|
||||||
this.$root.$emit('bv::show::modal', 'verify-username');
|
|
||||||
},
|
|
||||||
async runYesterDailies () {
|
async runYesterDailies () {
|
||||||
if (this.$store.state.isRunningYesterdailies) return;
|
if (this.$store.state.isRunningYesterdailies) return;
|
||||||
this.$store.state.isRunningYesterdailies = true;
|
this.$store.state.isRunningYesterdailies = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user