Skip to content

Commit 4b160e7

Browse files
committed
Add restart button to tray & save state on restart
1 parent 85b5df8 commit 4b160e7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/menu.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BrowserWindow, Menu, app } from "electron";
1+
import { app, BrowserWindow, Menu } from "electron";
22
import contextMenu from "electron-context-menu";
33
import { i } from "./modules/localization.ts";
44
import { cycleThroughPasswords } from "./modules/messageEncryption.ts";
@@ -43,6 +43,7 @@ export async function setApplicationMenu() {
4343
label: i("goofcord-restart"),
4444
accelerator: "Shift+CmdOrCtrl+R",
4545
click: async () => {
46+
await saveState(mainWindow, "windowState:main");
4647
app.relaunch();
4748
app.exit();
4849
},

src/tray.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Menu, Tray, app, dialog, nativeImage } from "electron";
1+
import { app, dialog, Menu, nativeImage, Tray } from "electron";
22
import { i } from "./modules/localization.ts";
33
import { saveState } from "./modules/windowStateManager.ts";
44
import { getDisplayVersion, getTrayIcon } from "./utils.ts";
@@ -44,6 +44,15 @@ export async function createTray() {
4444
{
4545
type: "separator",
4646
},
47+
{
48+
label: i("goofcord-restart"),
49+
accelerator: "Shift+CmdOrCtrl+R",
50+
click: async () => {
51+
await saveState(mainWindow, "windowState:main");
52+
app.relaunch();
53+
app.exit();
54+
},
55+
},
4756
{
4857
label: i("goofcord-quit"),
4958
click: async () => {

0 commit comments

Comments
 (0)