Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/sd_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ void readFs(FS &fs, const String &folder, const String &allowed_ext) {
** Function: loopSD
** Where you choose what to do with your SD Files
**********************************************************************/
String loopSD(FS &fs, bool filePicker, const String &allowed_ext, String rootPath) {
String loopSD(FS &fs, bool filePicker, const String &allowed_ext, String rootPath, bool interpreter) {
delay(10);
if (!fs.exists(rootPath)) {
Serial.println("loopSD-> 1st exist test failed");
Expand Down Expand Up @@ -659,7 +659,7 @@ String loopSD(FS &fs, bool filePicker, const String &allowed_ext, String rootPat
readFs(fs, Folder, allowed_ext);
rebuildSdOptions();
}
index = loopOptions(sdOptions, MENU_TYPE_REGULAR, "", index, false, true, PAGE_JUMP_SIZE, false);
index = loopOptions(sdOptions, MENU_TYPE_REGULAR, "", index, interpreter, true, PAGE_JUMP_SIZE, false);

if (index < 0) { // ESC
BACK_FOLDER:
Expand Down
5 changes: 4 additions & 1 deletion src/core/sd_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ void readFs(FS &fs, const String &folder, const String &allowed_ext = "*");

bool sortList(const FileList &a, const FileList &b);

String loopSD(FS &fs, bool filePicker = false, const String &allowed_ext = "*", String rootPath = "/");
String loopSD(
FS &fs, bool filePicker = false, const String &allowed_ext = "*", String rootPath = "/",
bool interpreter = false
);

void viewFile(FS &fs, const String &filepath);

Expand Down
2 changes: 1 addition & 1 deletion src/modules/bjs_interpreter/dialog_js.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ JSValue native_dialogPickFile(JSContext *ctx, JSValue *this_val, int argc, JSVal
FS *fs = NULL;
if (SD.exists(filepath)) fs = &SD;
else if (LittleFS.exists(filepath)) fs = &LittleFS; // ← added 'else'
if (fs) { r = loopSD(*fs, true, extension, filepath); }
if (fs) { r = loopSD(*fs, true, extension, filepath, true); }
return JS_NewString(ctx, r.c_str());
}

Expand Down
Loading