move api calls to created event (#559)

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-06-17 19:48:54 -08:00
committed by GitHub
parent 71a5de3432
commit d272784469
31 changed files with 70 additions and 55 deletions

View File

@@ -48,32 +48,16 @@ export default {
},
},
async mounted() {
async created() {
// Initial API Requests
this.$store.dispatch("initTheme");
this.$store.dispatch("requestRecentRecipes");
this.$store.dispatch("refreshToken");
this.$store.dispatch("requestCurrentGroup");
this.$store.dispatch("requestUserData");
this.$store.dispatch("requestCategories");
this.$store.dispatch("requestCurrentGroup");
this.$store.dispatch("requestTags");
this.darkModeSystemCheck();
this.darkModeAddEventListener();
this.$store.dispatch("requestAppInfo");
this.$store.dispatch("requestCustomPages");
this.$store.dispatch("requestSiteSettings");
},
data() {
return {
refreshing: false,
registration: null,
snackBtnText: "",
snackWithBtnText: "",
snackWithButtons: false,
};
},
created() {
// Listen for swUpdated event and display refresh snackbar as required.
document.addEventListener("swUpdated", this.showRefreshUI, { once: true });
// Refresh all open app tabs when a new service worker is installed.
@@ -86,6 +70,21 @@ export default {
}
},
mounted() {
this.darkModeSystemCheck();
this.darkModeAddEventListener();
},
data() {
return {
refreshing: false,
registration: null,
snackBtnText: "",
snackWithBtnText: "",
snackWithButtons: false,
};
},
methods: {
// For Later!