From cd58c0581aa319fbd7be7166f48919d8cb599900 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Fri, 23 Aug 2024 11:22:18 +0200 Subject: [PATCH] fix init after login, keep browser state --- components/ConfigChannel.vue | 1 - components/MediaBrowser.vue | 6 ++++-- pages/index.vue | 2 +- pages/media.vue | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/ConfigChannel.vue b/components/ConfigChannel.vue index e7750622..46195b48 100644 --- a/components/ConfigChannel.vue +++ b/components/ConfigChannel.vue @@ -132,7 +132,6 @@ async function onSubmitChannel() { if (update.status) { indexStore.msgAlert('success', t('config.updateChannelSuccess'), 2) - await configStore.getPlayoutConfig() } else { indexStore.msgAlert('error', t('config.updateChannelFailed'), 2) } diff --git a/components/MediaBrowser.vue b/components/MediaBrowser.vue index d845eb24..21105c49 100644 --- a/components/MediaBrowser.vue +++ b/components/MediaBrowser.vue @@ -96,8 +96,10 @@ defineProps({ }, }) -onMounted(() => { - mediaStore.getTree('') +onMounted(async () => { + if (!mediaStore.folderTree.parent || !mediaStore.currentPath) { + await mediaStore.getTree('') + } }) watch([id], () => { diff --git a/pages/index.vue b/pages/index.vue index 773e1313..257c2f87 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -127,7 +127,7 @@ async function login() { }, 3000) } - await configStore.nuxtClientInit() + await configStore.configInit() } catch (e) { formError.value = e as string } diff --git a/pages/media.vue b/pages/media.vue index acb4647b..633eddf1 100644 --- a/pages/media.vue +++ b/pages/media.vue @@ -368,7 +368,7 @@ onMounted(async () => { extensions.value = exts.join(', ') - if (!mediaStore.folderTree.parent) { + if (!mediaStore.folderTree.parent || !mediaStore.currentPath) { await mediaStore.getTree('') } })