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/account.vue | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

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

diff --git a/src/site/pages/dashboard/account.vue b/src/site/pages/dashboard/account.vue
index 05b969b..5d5d775 100644
--- a/src/site/pages/dashboard/account.vue
+++ b/src/site/pages/dashboard/account.vue
@@ -104,9 +104,7 @@ export default {
 	components: {
 		Sidebar
 	},
-	middleware: ['auth', ({ store }) => {
-		store.dispatch('auth/fetchCurrentUser');
-	}],
+	middleware: ['auth'],
 	data() {
 		return {
 			password: '',
@@ -120,6 +118,9 @@ export default {
 			user: state => state.auth.user
 		})
 	},
+	async asyncData({ app }) {
+		await app.store.dispatch('auth/fetchCurrentUser');
+	},
 	methods: {
 		...mapActions({
 			getUserSetttings: 'auth/fetchCurrentUser'
-- 
cgit v1.2.3

