Merge branch 'sabrecat/force-username-modal' into sabrecat/usernames-master

This commit is contained in:
Sabe Jones
2018-10-17 15:29:23 -05:00
14 changed files with 475 additions and 23 deletions

View File

@@ -25,6 +25,7 @@ div
login-incentives(:data='notificationData')
quest-completed
quest-invitation
verify-username
</template>
<style lang='scss'>
@@ -118,6 +119,7 @@ import streak from './achievements/streak';
import ultimateGear from './achievements/ultimateGear';
import wonChallenge from './achievements/wonChallenge';
import loginIncentives from './achievements/login-incentives';
import verifyUsername from './settings/verifyUsername';
const NOTIFICATIONS = {
CHALLENGE_JOINED_ACHIEVEMENT: {
@@ -178,6 +180,7 @@ export default {
dropsEnabled,
contributor,
loginIncentives,
verifyUsername,
},
data () {
// Levels that already display modals and should not trigger generic Level Up
@@ -323,6 +326,8 @@ export default {
this.goto('intro', 0);
}, 2000);
this.forceVerifyUsername();
this.runYesterDailies();
// Do not remove the event listener as it's live for the entire app lifetime
@@ -445,7 +450,8 @@ export default {
Promise.all([
this.$store.dispatch('user:fetch', {forceLoad: true}),
this.$store.dispatch('tasks:fetchUserTasks', {forceLoad: true}),
]).then(() => this.runYesterDailies());
]).then(() => this.forceVerifyUsername())
.then(() => this.runYesterDailies());
}
}, 1000),
scheduleNextCron () {
@@ -465,6 +471,11 @@ 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;