From 1562ca32f9762e1aa9f17b6cfdecf11501aeed8c Mon Sep 17 00:00:00 2001 From: MasutaYunikon Date: Tue, 7 Apr 2026 19:53:10 +0200 Subject: [PATCH] fix: MediaManagementView.vue api call is now in mounted --- src/views/settings/MediaManagementView.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/settings/MediaManagementView.vue b/src/views/settings/MediaManagementView.vue index 1abbd56..cb22b64 100644 --- a/src/views/settings/MediaManagementView.vue +++ b/src/views/settings/MediaManagementView.vue @@ -129,12 +129,10 @@ const form = ref({ autoImport : true, }) -const { data: systemInfo } = await fetch('/api/system/info') - const picker = ref<{ open: boolean; field: 'completePath' | 'mediaPath'; currentPath: string }>({ open: false, field: 'completePath', - currentPath: systemInfo.value?.defaultPath ?? '/', + currentPath: '/', }) function openPicker(field: 'completePath' | 'mediaPath') { @@ -192,4 +190,10 @@ async function scan() { scanning.value = false } } + +onMounted(async () => { + const res = await fetch('/api/system/info') + const systemInfo = await res.json() + picker.value.currentPath = systemInfo.defaultPath ?? '/' +}) \ No newline at end of file