Skip to content

Commit

Permalink
fix(baklava): macos crash
Browse files Browse the repository at this point in the history
  • Loading branch information
amitojsingh366 committed May 11, 2021
1 parent a89ce8a commit 9bbb8f0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions baklava/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dogehouse",
"version": "1.0.68",
"version": "1.0.69",
"description": "Taking voice conversations to the moon 🚀",
"main": "./dist/electron.js",
"scripts": {
Expand Down Expand Up @@ -118,7 +118,7 @@
"electron-log": "^4.3.2",
"electron-overlay-window": "^1.0.4",
"electron-updater": "^4.3.8",
"globalkey": "^1.0.6",
"globalkey": "^1.0.7",
"i18next": "^20.0.0",
"i18next-node-fs-backend": "^2.1.3"
},
Expand Down
10 changes: 4 additions & 6 deletions baklava/src/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import i18n from "i18next";
import Backend from "i18next-node-fs-backend";
import { autoUpdater } from "electron-updater";
import { RegisterKeybinds } from "./utils/keybinds";
import { exitApp, RegisterKeybinds } from "./utils/keybinds";

import { HandleVoiceTray } from "./utils/tray";
import {
Expand All @@ -25,7 +25,7 @@ import path from "path";
import { StartNotificationHandler } from "./utils/notifications";
import { bWindowsType } from "./types";
import electronLogger from "electron-log";
import { startRPC, stopRPC } from "./utils/rpc";
import { startRPC } from "./utils/rpc";

let mainWindow: BrowserWindow;
let tray: Tray;
Expand Down Expand Up @@ -230,8 +230,7 @@ if (!instanceLock) {
if (process.env.hotReload) {
app.relaunch();
}
stopRPC();
app.quit()
exitApp();
} else {
app.on("ready", () => {
localize().then(async () => {
Expand Down Expand Up @@ -282,8 +281,7 @@ autoUpdater.on("update-not-available", () => {
skipUpdateCheck(splash);
});
app.on("window-all-closed", async () => {
stopRPC();
app.quit()
exitApp();
});
app.on("activate", () => {
if (mainWindow === null) {
Expand Down
6 changes: 6 additions & 0 deletions baklava/src/utils/keybinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ export async function RegisterKeybinds(bWindows: bWindowsType) {
up => { }
);
}

export function exitApp() {
globalkey.stop();
stopRPC();
app.quit();
}
10 changes: 5 additions & 5 deletions baklava/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ __metadata:
electron-log: ^4.3.2
electron-overlay-window: ^1.0.4
electron-updater: ^4.3.8
globalkey: ^1.0.6
globalkey: ^1.0.7
i18next: ^20.0.0
i18next-node-fs-backend: ^2.1.3
lodash: ^4.17.21
Expand Down Expand Up @@ -1816,10 +1816,10 @@ __metadata:
languageName: node
linkType: hard

"globalkey@npm:^1.0.6":
version: 1.0.6
resolution: "globalkey@npm:1.0.6"
checksum: 6daf54a889313dfb3e11a2acf88e043a210ef1d3afa5e805cdcc598812268bb1cd1b60edf85d717be607d066d0c5c3f50bbaa177017a950b3874653256fda2b5
"globalkey@npm:^1.0.7":
version: 1.0.7
resolution: "globalkey@npm:1.0.7"
checksum: cbf4ab946601f7e5812430e5f585a326666df83b8d5d2e7cbfecb2251420fdad54e672ca46e4f7b6968404d828f2c716c43779c172bd6455241ede143e421300
languageName: node
linkType: hard

Expand Down

1 comment on commit 9bbb8f0

@vercel
Copy link

@vercel vercel bot commented on 9bbb8f0 May 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.