From 788bdc5b28643e0437dd29be9db2ae285e4d6bf7 Mon Sep 17 00:00:00 2001 From: Jake Donham Date: Tue, 19 Oct 2021 15:24:30 -0700 Subject: [PATCH] removed vestigial blur / focus handlers in Filesystem ran into https://github.com/electron/electron/pull/31401 because the web contents were destroyed before sending the events? but I guess those events were never actually sent --- src/app/index.ts | 3 --- src/files/Filesystem.ts | 12 ------------ src/main.ts | 4 ---- 3 files changed, 19 deletions(-) diff --git a/src/app/index.ts b/src/app/index.ts index 36ef5ff..1dfdae3 100644 --- a/src/app/index.ts +++ b/src/app/index.ts @@ -188,9 +188,6 @@ ipc.on('delete-note', deleteNote); ipc.on('publish-site', publishSite); -ipc.on('focus', () => Files.filesystem.start()); -ipc.on('blur', () => Files.filesystem.stop()); - ipc.on('set-data-dir', (_, path: string) => { Files.setPath(path) }); document.onmousemove = (e: MouseEvent) => { diff --git a/src/files/Filesystem.ts b/src/files/Filesystem.ts index 776f0ff..42e8414 100644 --- a/src/files/Filesystem.ts +++ b/src/files/Filesystem.ts @@ -63,8 +63,6 @@ type Filesystem = { rename: (oldPath: string, newPath: string) => void, exists: (path: string) => boolean, fsPaths: () => string[], - start: () => Promise, - stop: () => Promise, close: () => Promise, } @@ -375,14 +373,6 @@ function make( const fsPaths = () => [...fsFiles.keys()] - const start = async () => { - // timeout = Timers.setInterval(timerCallback, 1000); - } - - const stop = async () => { - // if (timeout) Timers.clearInterval(timeout); - } - const close = async () => { if (timeout) Timers.clearInterval(timeout); // TODO(jaked) ensure no updates after final write @@ -396,8 +386,6 @@ function make( rename, exists, fsPaths, - start, - stop, close }; } diff --git a/src/main.ts b/src/main.ts index 407237f..e4d71f4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -76,10 +76,6 @@ async function createWindow () { // Open the DevTools. // mainWindow.webContents.openDevTools() - // TODO(jaked) maybe there is a more direct way to do this? - mainWindow.on('focus', () => mainWindow?.webContents.send('focus')); - mainWindow.on('blur', () => mainWindow?.webContents.send('blur')); - // Emitted when the window is closed. mainWindow.on('closed', function () { // Dereference the window object, usually you would store windows