QuickCss: reopen existing window instead of new one
This commit is contained in:
parent
69a4d2734e
commit
2ab1c50c73
|
@ -139,8 +139,15 @@ export function initIpc(mainWindow: BrowserWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.handle(IpcEvents.OPEN_MONACO_EDITOR, async () => {
|
ipcMain.handle(IpcEvents.OPEN_MONACO_EDITOR, async () => {
|
||||||
|
const title = "Vencord QuickCSS Editor";
|
||||||
|
const existingWindow = BrowserWindow.getAllWindows().find(w => w.title === title);
|
||||||
|
if (existingWindow && !existingWindow.isDestroyed()) {
|
||||||
|
existingWindow.focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
title: "Vencord QuickCSS Editor",
|
title,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
darkTheme: true,
|
darkTheme: true,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
|
Loading…
Reference in a new issue