mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 16:49:07 +08:00
feat: enhance note saving functionality with immediate cache invalidation (#9725)
This commit is contained in:
parent
03ebc4a794
commit
10d6256ce1
@ -84,11 +84,13 @@ const NotesPage: FC = () => {
|
||||
|
||||
try {
|
||||
await window.api.file.write(activeFilePath, content)
|
||||
// 保存后立即刷新缓存,确保下次读取时获取最新内容
|
||||
invalidateFileContent(activeFilePath)
|
||||
} catch (error) {
|
||||
logger.error('Failed to save note:', error as Error)
|
||||
}
|
||||
},
|
||||
[activeFilePath, currentContent]
|
||||
[activeFilePath, currentContent, invalidateFileContent]
|
||||
)
|
||||
|
||||
// 防抖保存函数,在停止输入后才保存,避免输入过程中的文件写入
|
||||
|
||||
Loading…
Reference in New Issue
Block a user