mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-16 21:38:39 +00:00
Merge remote-tracking branch 'OFW/nm/js_archive_fixes' into dev
This commit is contained in:
commit
71a93e8cc3
3 changed files with 6 additions and 1 deletions
|
@ -15,7 +15,7 @@ void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder
|
|||
} else {
|
||||
for(size_t i = 0; i < COUNT_OF(known_ext); i++) {
|
||||
if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue;
|
||||
if(furi_string_search(file->path, known_ext[i], 0) != FURI_STRING_FAILURE) {
|
||||
if(furi_string_end_with(file->path, known_ext[i])) {
|
||||
if(i == ArchiveFileTypeBadUsb) {
|
||||
if(furi_string_search(
|
||||
file->path, archive_get_default_path(ArchiveTabBadUsb)) == 0) {
|
||||
|
|
|
@ -80,6 +80,7 @@ static bool browser_path_trim(FuriString* path) {
|
|||
return is_root;
|
||||
}
|
||||
static void browser_parse_ext_filter(ExtFilterArray_t ext_filter, const char* filter_str) {
|
||||
ExtFilterArray_reset(ext_filter);
|
||||
if(!filter_str) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -210,6 +210,7 @@ static void js_global_to_hex_string(struct mjs* mjs) {
|
|||
mjs_return(mjs, ret);
|
||||
}
|
||||
|
||||
#ifdef JS_DEBUG
|
||||
static void js_dump_write_callback(void* ctx, const char* format, ...) {
|
||||
File* file = ctx;
|
||||
furi_assert(ctx);
|
||||
|
@ -225,6 +226,7 @@ static void js_dump_write_callback(void* ctx, const char* format, ...) {
|
|||
storage_file_write(file, furi_string_get_cstr(str), furi_string_size(str));
|
||||
furi_string_free(str);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int32_t js_thread(void* arg) {
|
||||
JsThread* worker = arg;
|
||||
|
@ -255,6 +257,7 @@ static int32_t js_thread(void* arg) {
|
|||
|
||||
mjs_err_t err = mjs_exec_file(mjs, furi_string_get_cstr(worker->path), NULL);
|
||||
|
||||
#ifdef JS_DEBUG
|
||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||
FuriString* dump_path = furi_string_alloc_set(worker->path);
|
||||
furi_string_cat(dump_path, ".lst");
|
||||
|
@ -273,6 +276,7 @@ static int32_t js_thread(void* arg) {
|
|||
|
||||
furi_string_free(dump_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(err != MJS_OK) {
|
||||
FURI_LOG_E(TAG, "Exec error: %s", mjs_strerror(mjs, err));
|
||||
|
|
Loading…
Add table
Reference in a new issue