fix: clean up empty catch blocks in UI hooks and components

修复了 5 个 UI 组件和 hooks 中的空 catch 块:
- useDragToSystemDesktop.ts: 修复 2 个空 catch 块
- HomepageAuth.tsx: 修复 1 个空 catch 块
- HostManagerEditor.tsx: 修复 2 个空 catch 块

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-10-05 21:03:41 +08:00
parent f12c08845c
commit 3f9d0fad6b
3 changed files with 13 additions and 5 deletions

View File

@@ -118,7 +118,8 @@ export function HostManagerEditor({
setFolders(uniqueFolders); setFolders(uniqueFolders);
setSshConfigurations(uniqueConfigurations); setSshConfigurations(uniqueConfigurations);
} catch (error) { } catch {
// Failed to load hosts data
} finally { } finally {
setLoading(false); setLoading(false);
} }
@@ -152,7 +153,8 @@ export function HostManagerEditor({
setFolders(uniqueFolders); setFolders(uniqueFolders);
setSshConfigurations(uniqueConfigurations); setSshConfigurations(uniqueConfigurations);
} catch (error) { } catch {
// Failed to reload hosts after credential change
} finally { } finally {
setLoading(false); setLoading(false);
} }

View File

@@ -105,7 +105,9 @@ export function HomepageAuth({
const clearJWTOnLoad = async () => { const clearJWTOnLoad = async () => {
try { try {
await logoutUser(); await logoutUser();
} catch (error) {} } catch {
// Ignore logout errors on initial load
}
}; };
clearJWTOnLoad(); clearJWTOnLoad();

View File

@@ -59,7 +59,9 @@ export function useDragToSystemDesktop({
}; };
}); });
} }
} catch (error) {} } catch {
// IndexedDB not available or failed to retrieve directory
}
return null; return null;
}; };
@@ -75,7 +77,9 @@ export function useDragToSystemDesktop({
store.put({ handle: dirHandle }, "lastSaveDir"); store.put({ handle: dirHandle }, "lastSaveDir");
}; };
} }
} catch (error) {} } catch {
// Failed to save directory handle
}
}; };
const isFileSystemAPISupported = () => { const isFileSystemAPISupported = () => {