diff --git a/package.json b/package.json
index a51d874e..dc680846 100644
--- a/package.json
+++ b/package.json
@@ -29,6 +29,7 @@
"highlight.js": "11.2.0",
"is-touch-device": "1.0.1",
"lodash.clonedeep": "^4.5.0",
+ "lodash.debounce": "^4.0.8",
"marked": "3.0.7",
"register-service-worker": "1.7.2",
"snake-case": "3.0.4",
diff --git a/src/App.vue b/src/App.vue
index 90231eb0..d2690c26 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -54,6 +54,7 @@ export default defineComponent({
this.setupAccountDeletionVerification()
},
beforeCreate() {
+ // FIXME: async action in beforeCreate, might be not finished when component mounts
this.$store.dispatch('config/update')
.then(() => {
this.$store.dispatch('auth/checkAuth')
@@ -88,29 +89,30 @@ export default defineComponent({
window.addEventListener('offline', () => this.$store.commit(ONLINE, navigator.onLine))
},
setupPasswortResetRedirect() {
- if (typeof this.$route.query.userPasswordReset !== 'undefined') {
- localStorage.removeItem('passwordResetToken') // Delete an eventually preexisting old token
- localStorage.setItem('passwordResetToken', this.$route.query.userPasswordReset)
- this.$router.push({name: 'user.password-reset.reset'})
+ if (typeof this.$route.query.userPasswordReset === 'undefined') {
+ return
}
+
+ localStorage.setItem('passwordResetToken', this.$route.query.userPasswordReset)
+ this.$router.push({name: 'user.password-reset.reset'})
},
setupEmailVerificationRedirect() {
- if (typeof this.$route.query.userEmailConfirm !== 'undefined') {
- localStorage.removeItem('emailConfirmToken') // Delete an eventually preexisting old token
- localStorage.setItem('emailConfirmToken', this.$route.query.userEmailConfirm)
- this.$router.push({name: 'user.login'})
+ if (typeof this.$route.query.userEmailConfirm === 'undefined') {
+ return
}
+
+ localStorage.setItem('emailConfirmToken', this.$route.query.userEmailConfirm)
+ this.$router.push({name: 'user.login'})
},
- setupAccountDeletionVerification() {
- if (typeof this.$route.query.accountDeletionConfirm !== 'undefined') {
- const accountDeletionService = new AccountDeleteService()
- accountDeletionService.confirm(this.$route.query.accountDeletionConfirm)
- .then(() => {
- this.$message.success({message: this.$t('user.deletion.confirmSuccess')})
- this.$store.dispatch('auth/refreshUserInfo')
- })
- .catch(e => this.$message.error(e))
+ async setupAccountDeletionVerification() {
+ if (typeof this.$route.query.accountDeletionConfirm === 'undefined') {
+ return
}
+
+ const accountDeletionService = new AccountDeleteService()
+ await accountDeletionService.confirm(this.$route.query.accountDeletionConfirm)
+ this.$message.success({message: this.$t('user.deletion.confirmSuccess')})
+ this.$store.dispatch('auth/refreshUserInfo')
},
},
})
diff --git a/src/components/home/contentAuth.vue b/src/components/home/contentAuth.vue
index ff055830..b4b6c527 100644
--- a/src/components/home/contentAuth.vue
+++ b/src/components/home/contentAuth.vue
@@ -128,9 +128,6 @@ export default {
},
loadLabels() {
this.$store.dispatch('labels/loadAllLabels')
- .catch(e => {
- this.$message.error(e)
- })
},
},
}
diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue
index 44a3c9a0..16258985 100644
--- a/src/components/home/navigation.vue
+++ b/src/components/home/navigation.vue
@@ -54,14 +54,14 @@