1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 18:06:22 +00:00

QuickCss: reopen existing window instead of new one

This commit is contained in:
Vendicated 2024-01-13 19:27:41 +01:00 committed by Luna
parent 8c27a5c4a6
commit 2139492f85

View file

@ -139,8 +139,15 @@ export function initIpc(mainWindow: BrowserWindow) {
}
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({
title: "Vencord QuickCSS Editor",
title,
autoHideMenuBar: true,
darkTheme: true,
webPreferences: {