Skip to content

Commit

Permalink
removed vestigial blur / focus handlers in Filesystem
Browse files Browse the repository at this point in the history
ran into electron/electron#31401
because the web contents were destroyed before sending the events?
but I guess those events were never actually sent
  • Loading branch information
jaked committed Oct 19, 2021
1 parent 7269b7a commit 788bdc5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
3 changes: 0 additions & 3 deletions src/app/index.ts
Expand Up @@ -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) => {
Expand Down
12 changes: 0 additions & 12 deletions src/files/Filesystem.ts
Expand Up @@ -63,8 +63,6 @@ type Filesystem = {
rename: (oldPath: string, newPath: string) => void,
exists: (path: string) => boolean,
fsPaths: () => string[],
start: () => Promise<void>,
stop: () => Promise<void>,
close: () => Promise<void>,
}

Expand Down Expand Up @@ -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
Expand All @@ -396,8 +386,6 @@ function make(
rename,
exists,
fsPaths,
start,
stop,
close
};
}
Expand Down
4 changes: 0 additions & 4 deletions src/main.ts
Expand Up @@ -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
Expand Down

0 comments on commit 788bdc5

Please sign in to comment.