feat(usernames): modal to force verification

This commit is contained in:
Sabe Jones
2018-10-13 12:53:16 -05:00
parent 6f5b9ef119
commit fa1fef11d6
10 changed files with 392 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ div
login-incentives(:data='notificationData')
quest-completed
quest-invitation
verify-username
</template>
<style lang='scss'>
@@ -116,6 +117,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';
export default {
mixins: [notifications, guide],
@@ -143,6 +145,7 @@ export default {
dropsEnabled,
contributor,
loginIncentives,
verifyUsername,
},
data () {
// Levels that already display modals and should not trigger generic Level Up
@@ -294,6 +297,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
@@ -349,7 +354,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 () {
@@ -369,6 +375,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;