diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index d95d5a4..dec7740 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -642,13 +642,6 @@ export default { this.settings.general.description.value = res.data.description; this.loading = false; }) - .catch(() => { - this.$buefy.snackbar.open({ - message: this.$t("errors.authFail"), - type: "is-warning", - }); - this.loading = false; - }); }, }, mounted() { @@ -673,34 +666,32 @@ export default { type: "is-info", }); }); - this.axios - .get( - process.env.VUE_APP_API_ENDPOINT + - process.env.VUE_APP_API_VERSION + - "/" + - "userinfo" - ) - .then((res) => { - this.$store.commit("setUsername", res.data.username); - this.$store.commit("setEmail", res.data.email); - this.$store.commit("setEmailVerified", res.data.emailVerified); - this.$store.commit("setAdmin", res.data.admin); - this.$store.commit("setKoins", res.data.koins); - this.$store.commit("setID", res.data.id); - this.$store.commit("setBot", res.data.bot); - this.$store.commit("setDescription", res.data.description); - this.$store.commit("setExecutive", res.data.executive); - this.settings.general.description.value = res.data.description; - this.loading = false; - }) - .catch(() => { - this.$buefy.snackbar.open({ - message: this.$t("errors.authFail"), - type: "is-warning", - }); - this.loading = false; - console.log(this.getBannerId()); - }); + this.$nextTick(() => { + this.axios + .get( + process.env.VUE_APP_API_ENDPOINT + + process.env.VUE_APP_API_VERSION + + "/" + + "userinfo" + ) + .then((res) => { + this.$store.commit("setUsername", res.data.username); + this.$store.commit("setEmail", res.data.email); + this.$store.commit("setEmailVerified", res.data.emailVerified); + this.$store.commit("setAdmin", res.data.admin); + this.$store.commit("setKoins", res.data.koins); + this.$store.commit("setID", res.data.id); + this.$store.commit("setBot", res.data.bot); + this.$store.commit("setDescription", res.data.description); + this.$store.commit("setExecutive", res.data.executive); + this.settings.general.description.value = res.data.description; + this.loading = false; + }) + .catch(() => { + this.loading = false; + console.log(this.getBannerId()); + }); + }) this.$nextTick(() => { this.dailyReward(false); this.showUpdate(); diff --git a/src/views/Home.vue b/src/views/Home.vue index 7ca6e8d..29449ab 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -188,24 +188,25 @@ export default { } }); }, + getBlog() { + this.axios + .get( + process.env.VUE_APP_API_ENDPOINT + + process.env.VUE_APP_API_VERSION + + `/` + + `blog/posts` + ) + .then((res) => { + this.blogs = res.data; + }) + .catch((e) => { + AjaxErrorHandler(this.$store)(e); + }); + } }, mounted() { - if (this.$store.state.user.username) { - this.axios - .get( - process.env.VUE_APP_API_ENDPOINT + - process.env.VUE_APP_API_VERSION + - `/` + - `blog/posts` - ) - .then((res) => { - this.blogs = res.data; - }) - .catch((e) => { - AjaxErrorHandler(this.$store)(e); - }); - this.getWall(true); - } + this.getBlog() + this.getWall(true); }, }; \ No newline at end of file