From acda3599b280d70766e8b83420f7189b94fd99fe Mon Sep 17 00:00:00 2001 From: Nick Oates Date: Fri, 18 Oct 2024 09:33:11 -0700 Subject: [PATCH] Update editor.native.ts --- plugins/Themer/src/editor.native.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Themer/src/editor.native.ts b/plugins/Themer/src/editor.native.ts index bbb24ee..9744ad0 100644 --- a/plugins/Themer/src/editor.native.ts +++ b/plugins/Themer/src/editor.native.ts @@ -2,6 +2,9 @@ import { BrowserWindow, shell, ipcMain } from "electron"; import editor from "file://editor.html?base64&minify"; import path from "path"; +ipcMain.removeHandler("THEMER_SET_CSS"); +ipcMain.handle("THEMER_SET_CSS", setCSS); + let win: BrowserWindow | null = null; export const openEditor = async (css: string) => { if (win && !win.isDestroyed()) return win.focus(); @@ -29,7 +32,7 @@ export const openEditor = async (css: string) => { win.loadURL(`data:text/html;base64,${editor}`); }; -export const setCSS = async (css: string) => { +const setCSS = async (event: any, css: string) => { BrowserWindow.getAllWindows().forEach((win) => { win.webContents.send("THEMER_SET_CSS", css); });