From a3bf693d30d3c1c1d9e4073830522554c3f1c4e8 Mon Sep 17 00:00:00 2001
From: Pitu <heyitspitu@gmail.com>
Date: Wed, 20 Jan 2021 14:09:06 +0900
Subject: chore: switch to asyncData where needed

---
 src/site/pages/dashboard/index.vue | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/site/pages/dashboard/index.vue')

diff --git a/src/site/pages/dashboard/index.vue b/src/site/pages/dashboard/index.vue
index 4877e15..bd7b745 100644
--- a/src/site/pages/dashboard/index.vue
+++ b/src/site/pages/dashboard/index.vue
@@ -68,7 +68,6 @@ export default {
 	},
 	middleware: ['auth', ({ store }) => {
 		store.commit('images/resetState');
-		store.dispatch('images/fetch');
 	}],
 	data() {
 		return {
@@ -88,7 +87,10 @@ export default {
 	watch: {
 		current: 'fetchPaginate'
 	},
-	created() {
+	async asyncData({ app }) {
+		await app.store.dispatch('images/fetch');
+	},
+	mounted() {
 		this.filteredHints = this.hints; // fixes the issue where on pageload, suggestions wont load
 	},
 	methods: {
-- 
cgit v1.2.3

