From dea1ca90b1a0b387dd16530013b0670be6b4a821 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 5 Oct 2025 21:05:36 +0800 Subject: [PATCH] fix: clean up empty blocks in file manager and credential editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了 5 个空块: - FileManagerGrid.tsx: 移除 1 个空 else 块和 1 个空 if 块 - CredentialEditor.tsx: 修复 1 个空 catch 块,移除 2 个空 if/else 块 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx | 7 ++----- src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx b/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx index 9303c0b8..84119637 100644 --- a/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx +++ b/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx @@ -79,7 +79,8 @@ export function CredentialEditor({ ].sort() as string[]; setFolders(uniqueFolders); - } catch (error) { + } catch { + // Failed to load credentials } finally { setLoading(false); } @@ -636,10 +637,6 @@ export function CredentialEditor({ form.setValue("key", null); form.setValue("keyPassword", ""); form.setValue("keyType", "auto"); - - if (newAuthType === "password") { - } else if (newAuthType === "key") { - } }} className="flex-1 flex flex-col h-full min-h-0" > diff --git a/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx b/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx index 039f75eb..0a636411 100644 --- a/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx +++ b/src/ui/Desktop/Apps/File Manager/FileManagerGrid.tsx @@ -327,7 +327,6 @@ export function FileManagerGrid({ dragState.files[0].type === "file" ) { onFileDiff?.(dragState.files[0], targetFile); - } else { } setDragState({ type: "none", files: [], counter: 0 }); @@ -458,8 +457,6 @@ export function FileManagerGrid({ type: "external", counter: prev.counter + 1, })); - if (e.dataTransfer.items && e.dataTransfer.items.length > 0) { - } } }, [dragState.type],