v0.1.1: 多Agent代码质量审查+优化
- fix: useCodeMirror onChange闭包过期导致编辑器内容丢失同步(P0) - feat: 全部组件添加displayName(React DevTools调试支持) - feat: 全部组件添加ARIA属性(WCAG无障碍支持) - fix: App异步操作添加try-catch错误边界 - fix: tabStore空catch块添加错误日志 - fix: sidebarStore Set→string[](Zustand可序列化) - fix: useDragDrop readFile错误处理+空文件修复 - fix: useSettings/useTheme load()添加错误处理 - fix: useTheme toggleDarkMode引用优化 - chore: 版本号升级至0.1.1
This commit is contained in:
@@ -26,9 +26,13 @@ export function useDragDrop(showToast: (msg: string) => void) {
|
||||
}
|
||||
|
||||
if (window.electronAPI) {
|
||||
const result = await window.electronAPI.readFile(filePath)
|
||||
if (result.success && result.content) {
|
||||
createTab(filePath, result.content)
|
||||
try {
|
||||
const result = await window.electronAPI.readFile(filePath)
|
||||
if (result.success && result.content !== undefined) {
|
||||
createTab(filePath, result.content)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to read file via electronAPI:', err)
|
||||
}
|
||||
} else {
|
||||
const reader = new FileReader()
|
||||
|
||||
Reference in New Issue
Block a user