Skip to content

Commit

Permalink
other: removed bg worker progress
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkoelle committed May 23, 2021
1 parent f417e64 commit f4f142f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
12 changes: 0 additions & 12 deletions app/background.html

This file was deleted.

25 changes: 7 additions & 18 deletions app/main.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import AutoCorrection from './autocorrection';
import { RECEIVE_FILE_PATH, REQUEST_FILE_PATH } from './constants/OpenFileIPC';

let mainWindow: BrowserWindow | null = null;
let bgWindow: BrowserWindow | null = null;
let file = '';

if (process.env.NODE_ENV === 'production') {
Expand All @@ -47,19 +46,6 @@ const installExtensions = async () => {
).catch(console.log);
};

function createBgWindow() {
bgWindow = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true,
},
});
bgWindow.loadURL(`file://${__dirname}/background.html`);
bgWindow.on('closed', () => {
bgWindow = null;
});
}

const createWindow = async () => {
if (
process.env.NODE_ENV === 'development' ||
Expand All @@ -76,6 +62,13 @@ const createWindow = async () => {
return path.join(RESOURCES_PATH, ...paths);
};

ipcMain.on('bg-ready', (event, win) => {
const { sender } = event;
console.log('Background worker ready!', win);
sender.send('transferMainWindow', 'test');
// send reference to main window
});

mainWindow = new BrowserWindow({
show: false,
width: 1400,
Expand Down Expand Up @@ -107,16 +100,12 @@ const createWindow = async () => {
});

mainWindow.on('closed', () => {
bgWindow?.close();
mainWindow = null;
});

const menuBuilder = new MenuBuilder(mainWindow);
menuBuilder.buildMenu();

// Create background worker window
if (bgWindow === null) createBgWindow();

new AppUpdater();
new Backup();
new Importer(mainWindow);
Expand Down

0 comments on commit f4f142f

Please sign in to comment.