fix inline edit can't up error

This commit is contained in:
duanfuxiang
2025-04-30 18:47:14 +08:00
parent dfdb21e832
commit 92b5c8fe61
6 changed files with 97 additions and 39 deletions

View File

@@ -53,8 +53,11 @@ export default function ApplyViewRoot({
}
return result;
}, '')
await app.vault.modify(state.file, newContent)
const file = app.vault.getFileByPath(state.file)
if (!file) {
throw new Error('File not found')
}
await app.vault.modify(file, newContent)
if (state.onClose) {
state.onClose(true)
}