From 665b88b7877ac084cd52b08d0d725f98438a7c3e Mon Sep 17 00:00:00 2001 From: md8n Date: Wed, 18 Dec 2024 14:10:32 +0900 Subject: [PATCH] Fix isdir setting in files --- www/js/files.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/js/files.js b/www/js/files.js index e31f84d82..4c55d4e2a 100644 --- a/www/js/files.js +++ b/www/js/files.js @@ -414,11 +414,12 @@ const files_list_success = (response_text) => { for (let i = 0; i < response.files.length; i++) { const file = response.files[i]; const file_name = file.name; + const isdirectory = file.size === "-1"; files_file_list.push({ name: file_name, sdname: file_name, - size: (file.size !== "-1") ? file.size : "", - isdir: file.size === "-1", + size: !isdirectory ? file.size : "", + isdir: isdirectory, datetime: file.datetime, isprintable: files_isgcode(file_name, isdirectory), });