fix splash screen

This commit is contained in:
riqo 2021-03-04 10:36:53 -06:00
commit c7f91d3e6b
8 changed files with 61 additions and 77 deletions

View file

@ -4,10 +4,11 @@
import { app } from "electron";
import { main } from './run';
import { backgroundMitt } from './emitter';
import { stopStream } from './audio';
let winActive: boolean;
backgroundMitt.once('window-active', (state: boolean) => {
backgroundMitt.on('window-active', (state: boolean) => {
winActive = state;
});
@ -20,11 +21,11 @@ export function initApp(dev: boolean): void {
// Quit when all windows are closed.
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
stopStream();
app.quit();
}
});
// Might have to de-reference window object
app.on("activate", () => {
if (winActive === false) {
main();