diff --git a/src/components/Panels/Files.js b/src/components/Panels/Files.js index 454081180..044ecb365 100644 --- a/src/components/Panels/Files.js +++ b/src/components/Panels/Files.js @@ -181,11 +181,10 @@ const FilesPanel = () => { : T("S84").replace("%s", feedback.arg), type: "error", }) - } else { - //Success now refresh content" - onRefresh(null, false) - return } + //Refresh content either way, the list shows what is really there + onRefresh(null, false) + return } } setIsLoading(false) diff --git a/src/targets/Printer3D/Marlin/SD-source.js b/src/targets/Printer3D/Marlin/SD-source.js index e77b23774..c5d222a7f 100644 --- a/src/targets/Printer3D/Marlin/SD-source.js +++ b/src/targets/Printer3D/Marlin/SD-source.js @@ -168,9 +168,17 @@ const responseSteps = { }, delete: { start: (data) => data.startsWith("File deleted"), - end: (data) => data.startsWith("ok") && !data.startsWith("ok T:"), + // An "ok" from M21 or from polling can come before "File deleted" + // and would end the query as an error, so end on the message itself + end: (data) => data.startsWith("File deleted"), error: (data) => { - return data.startsWith("Deletion failed") + return ( + data.startsWith("Deletion failed") || + data.indexOf("echo:No SD card") != -1 || + data.indexOf("echo:No media") != -1 || + data.indexOf('echo:Unknown command: "M21"') != -1 || + data.indexOf('echo:Unknown command: "M30"') != -1 + ) }, }, }