fix: MediaManagementView.vue api call is now in mounted
This commit is contained in:
1 parent
42b46496d1
commit
1562ca32f9
1 file changed
+7
-3
@@ -129,12 +129,10 @@ const form = ref({
|
|||||||
autoImport : true,
|
autoImport : true,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { data: systemInfo } = await fetch('/api/system/info')
|
|
||||||
|
|
||||||
const picker = ref<{ open: boolean; field: 'completePath' | 'mediaPath'; currentPath: string }>({
|
const picker = ref<{ open: boolean; field: 'completePath' | 'mediaPath'; currentPath: string }>({
|
||||||
open: false,
|
open: false,
|
||||||
field: 'completePath',
|
field: 'completePath',
|
||||||
currentPath: systemInfo.value?.defaultPath ?? '/',
|
currentPath: '/',
|
||||||
})
|
})
|
||||||
|
|
||||||
function openPicker(field: 'completePath' | 'mediaPath') {
|
function openPicker(field: 'completePath' | 'mediaPath') {
|
||||||
@@ -192,4 +190,10 @@ async function scan() {
|
|||||||
scanning.value = false
|
scanning.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const res = await fetch('/api/system/info')
|
||||||
|
const systemInfo = await res.json()
|
||||||
|
picker.value.currentPath = systemInfo.defaultPath ?? '/'
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
Reference in new issue
Block a user