Skip to content

Commit

Permalink
Update editor.native.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ckoates authored Oct 18, 2024
1 parent c72e850 commit acda359
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/Themer/src/editor.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit acda359

Please sign in to comment.