diff --git a/src/components/Panels/Files.js b/src/components/Panels/Files.js index 21967a1d..772c7fdc 100644 --- a/src/components/Panels/Files.js +++ b/src/components/Panels/Files.js @@ -48,6 +48,7 @@ import { Menu as PanelMenu } from "./" let currentFS = "" const currentPath = {} const filesListCache = {} +let currentFSNeedInit = true /* * Local const @@ -55,6 +56,10 @@ const filesListCache = {} */ const FilesPanel = () => { const { panels, uisettings } = useUiContext() + if (currentFS == "") { + currentFS = useUiContextFn.getValue("default_filesystem") + if (typeof currentFS === "undefined") currentFS = "" + } const id = "filesPanel" const [filePath, setFilePath] = useState(currentPath[currentFS]) const [isLoading, setIsLoading] = useState(false) @@ -66,8 +71,10 @@ const FilesPanel = () => { const { modals, toasts } = useUiContext() const fileref = useRef() const dropRef = useRef() - const progressBar = {} - + const progressBar = {} + console.log("currentFS", currentFS) + + console.log(currentFS) const onCancel = () => { useUiContextFn.haptic() processor.stopCatchResponse() @@ -544,6 +551,12 @@ const FilesPanel = () => { if (fs) { currentFS = fs.value onSelectFS(null, !useUiContextFn.getValue("autoload")) + currentFSNeedInit = false + } + } else { + if (currentFSNeedInit) { + currentFSNeedInit = false + onSelectFS(null, !useUiContextFn.getValue("autoload")) } } setupFileInput() diff --git a/src/targets/Printer3D/Marlin/preferences.json b/src/targets/Printer3D/Marlin/preferences.json index 2295f0d2..dd4f3cfc 100644 --- a/src/targets/Printer3D/Marlin/preferences.json +++ b/src/targets/Printer3D/Marlin/preferences.json @@ -214,7 +214,21 @@ "value": true } ] - } + }, + { + "id": "default_filesystem", + "type": "select", + "label": "S223", + "value": "flashfs", + "options": [ + { "value": "FLASH", "label": "S137", "depend": [{ "id": "flashfs", "value": true }] }, + { "value": "SD", "label": "S190" , "depend": [{ "id": "sd", "value": true }, { "connection_id": "SDConnection", "value": "=='none'"}] }, + { "value": "SDEXT", "label": "S191", "depend": [{ "id": "sdext", "value": true }] }, + { "value": "TFTSD", "label": "S188", "depend": [{ "id": "tftsd", "value": true }] }, + { "value": "TFTUSB", "label": "S189", "depend": [{ "id": "tftusb", "value": true }] }, + { "value": "DIRECTSD", "label": "S190", "depend": [{ "id": "sd", "value": true }, { "connection_id": "SDConnection", "value": "!='none'"}] } + ] + } ], "extruders": [ { diff --git a/src/targets/translations/en.json b/src/targets/translations/en.json index 45576e7b..7f07a540 100644 --- a/src/targets/translations/en.json +++ b/src/targets/translations/en.json @@ -227,6 +227,7 @@ "S220": "Makerbase", "S221": "Bigtreetech", "S222": "Error loading file:", + "S223": "Default filesystem", "btn+X": "X+", "btn-X": "X-", "btnHX": "Home X",