mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
feat(usernames): modal to force verification
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user