refactor(control): improve code quality

This commit is contained in:
E44
2026-06-10 21:16:36 +02:00
parent a7582851b4
commit b6c637649f
2 changed files with 3 additions and 2 deletions
@@ -59,7 +59,7 @@ export async function add_upload(
};
const file_primary_key = get_file_primary_key(db_file);
if (Object.prototype.hasOwnProperty.call(file_transfer_tasks, file_primary_key))
if (Object.hasOwn(file_transfer_tasks, file_primary_key))
return show_already_in_tasks_error(db_file, 'upload'); // file is already in task
await db.files.put(db_file);
+2 -1
View File
@@ -59,9 +59,10 @@
$effect(() => {
const s = $selected_file_ids;
one_file_selected = liveQuery(async () => {
if (s.length !== 1) return false
const inode = await get_file_by_id(s[0]);
if (!inode) return false;
return s.length === 1 && !is_folder(inode);
return !is_folder(inode);
});
});