From 8ea3e3bc3c7162ceb1dfb0085fccf33086cd7705 Mon Sep 17 00:00:00 2001 From: Jaime Idolpx Date: Sun, 7 Jun 2026 22:07:13 -0400 Subject: [PATCH] feat: update mountOnDevice function to set device URL directly from mountEntry path and enable device if not already enabled --- src/app/components/FileManager.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);