mirror of
https://github.com/heyman/heynote.git
synced 2024-12-11 09:11:31 +01:00
Don't trigger buffer:change event when file is removed
This commit is contained in:
parent
cf2be9723d
commit
40771b8fb5
@ -164,7 +164,8 @@ export class FileLibrary {
|
||||
for (const [path, buffer] of Object.entries(this.files)) {
|
||||
if (changedPath === basename(path)) {
|
||||
const content = await buffer.read()
|
||||
if (buffer._lastSavedContent !== content) {
|
||||
// if the file was removed (e.g. during a atomic save) the content will be undefined
|
||||
if (content !== undefined && buffer._lastSavedContent !== content) {
|
||||
win.webContents.send("buffer:change", path, content)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user