From 4c0247847010dd75eaf4e3f363d4686d1026eb0d Mon Sep 17 00:00:00 2001 From: wvffle Date: Thu, 21 Jul 2022 23:19:16 +0000 Subject: [PATCH] Fetch all user info on startup --- front/src/App.vue | 5 ++ front/src/components/Sidebar.vue | 32 ----------- front/src/components/auth/LoginForm.vue | 16 ++---- front/src/store/auth.ts | 71 ++++++++++++------------- front/src/store/channels.ts | 12 ++--- front/src/store/favorites.ts | 16 +++--- front/src/store/libraries.ts | 12 ++--- front/src/store/moderation.ts | 42 +++++++-------- front/src/store/playlists.ts | 2 +- front/src/views/auth/Login.vue | 7 +-- 10 files changed, 85 insertions(+), 130 deletions(-) diff --git a/front/src/App.vue b/front/src/App.vue index 52691e903..b56cf9bc3 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -67,6 +67,11 @@ onKeyboardShortcut('h', () => toggleShortcutsModal()) const { width } = useWindowSize() const showSetInstanceModal = ref(false) + +// Fetch user data on startup +if (store.state.auth.authenticated) { + store.dispatch('auth/fetchUser') +}