diff --git a/src/app/components/FileManager.tsx b/src/app/components/FileManager.tsx index b1aa028..0dd18d7 100644 --- a/src/app/components/FileManager.tsx +++ b/src/app/components/FileManager.tsx @@ -29,7 +29,6 @@ import { createFolder, deletePath, getFileContents, - getWebDAVBaseUrl, humanFileSize, joinPath, listDirectory, @@ -295,13 +294,14 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa // Mount disk image onto a drive device const mountOnDevice = (deviceType: 'drive' | 'meatloaf', key: string) => { if (!mountEntry || !setConfig || !config) return; - const url = `${getWebDAVBaseUrl()}${mountEntry.path}`; const newConfig = JSON.parse(JSON.stringify(config)); if (!newConfig.iec) newConfig.iec = {}; if (!newConfig.iec.devices) newConfig.iec.devices = {}; if (!newConfig.iec.devices[deviceType]) newConfig.iec.devices[deviceType] = {}; if (!newConfig.iec.devices[deviceType][key]) newConfig.iec.devices[deviceType][key] = {}; - newConfig.iec.devices[deviceType][key].url = url; + const dev = newConfig.iec.devices[deviceType][key]; + dev.url = mountEntry.path; + if (!dev.enabled) dev.enabled = 1; setConfig(newConfig); toast.success(`Mounted "${mountEntry.name}" on device #${key}`); setMountEntry(null);