Check all open buffer files for changes when window gets focus

The reason we do this is because fs.watch() is unreliable in some case.

#build
This commit is contained in:
Jonatan Heyman
2024-10-29 12:27:17 +01:00
parent 6c95005544
commit 374e2b4e5d
2 changed files with 55 additions and 31 deletions

View File

@@ -316,7 +316,7 @@ function registerAlwaysOnTop() {
app.whenReady().then(createWindow).then(async () => {
initFileLibrary(win).then(() => {
setupFileLibraryEventHandlers(win)
setupFileLibraryEventHandlers()
})
initializeAutoUpdate(win)
registerGlobalHotkey()
@@ -375,8 +375,8 @@ async function initFileLibrary(win) {
}
try {
fileLibrary = new FileLibrary(libraryPath)
fileLibrary.setupWatcher(win)
fileLibrary = new FileLibrary(libraryPath, win)
fileLibrary.setupWatcher()
} catch (error) {
initErrors.push(`Error: ${error.message}`)
}