fix splash screen
This commit is contained in:
parent
854d6dd6a2
commit
c7f91d3e6b
8 changed files with 61 additions and 77 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue