fix(files): 未命名保存后刷新文件树;关闭 Tauri 拖放拦截放行侧栏 HTML5 拖拽(docs/25 回修)

This commit is contained in:
Muse
2026-11-14 17:08:01 +08:00
parent c2958ebf8c
commit 13271f11b6
3 changed files with 18 additions and 1 deletions

View File

@@ -346,6 +346,7 @@ export default function App() {
minWidth: 920,
minHeight: 600,
decorations: false,
dragDropEnabled: false,
})
} catch (e) { setError(`打开新窗口失败:${String(e)}`) }
}, [])
@@ -389,6 +390,8 @@ export default function App() {
}
await writeTextFile(path, toDiskContent(snapshot, target.lineEnding), target.hadBom)
dispatch({ type: 'saved', id: target.id, savedContent: snapshot, path, title: baseName(path) })
// 落点变化(未命名首次保存、另存为)意味着磁盘上多/改了一个文件,刷新左侧文件树
if (target.path !== path) setTreeRefresh((n) => n + 1)
const stat = await statFile(path)
if (stat.exists) baselinesRef.current.set(target.id, { mtimeMs: stat.mtimeMs, size: stat.size })
// 恢复记录可能按旧键(未命名/旧路径)写入,新旧键都清,避免下次启动误报草稿