refactor: simplify theme import handling and remove redundant code

This commit is contained in:
Hachi-R 2025-02-16 16:10:02 -03:00
parent ef28337729
commit 569c80cbf4
9 changed files with 53 additions and 85 deletions

View file

@ -362,15 +362,6 @@ contextBridge.exposeInMainWorld("electron", {
getActiveCustomTheme: () => ipcRenderer.invoke("getActiveCustomTheme"),
toggleCustomTheme: (themeId: string, isActive: boolean) =>
ipcRenderer.invoke("toggleCustomTheme", themeId, isActive),
onImportTheme: (cb: (theme: string, author: string) => void) => {
const listener = (
_event: Electron.IpcRendererEvent,
theme: string,
author: string
) => cb(theme, author);
ipcRenderer.on("import-theme", listener);
return () => ipcRenderer.removeListener("import-theme", listener);
},
/* Editor */
openEditorWindow: (themeId: string) =>