mirror of
https://github.com/heyman/heynote.git
synced 2025-02-08 22:40:37 +01:00
Don't trigger buffer:change event when file is removed
This commit is contained in:
parent
2f9b6b8aab
commit
c47d824111
@ -164,7 +164,8 @@ export class FileLibrary {
|
|||||||
for (const [path, buffer] of Object.entries(this.files)) {
|
for (const [path, buffer] of Object.entries(this.files)) {
|
||||||
if (changedPath === basename(path)) {
|
if (changedPath === basename(path)) {
|
||||||
const content = await buffer.read()
|
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)
|
win.webContents.send("buffer:change", path, content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user