feat: add deep link theme import functionality

This commit is contained in:
Hachi-R 2025-02-16 01:27:15 -03:00
parent 39ceb8ee6e
commit d7d88ecb8c
8 changed files with 174 additions and 35 deletions

View file

@ -360,6 +360,12 @@ contextBridge.exposeInMainWorld("electron", {
getCustomThemeById: (themeId: string) =>
ipcRenderer.invoke("getCustomThemeById", themeId),
getActiveCustomTheme: () => ipcRenderer.invoke("getActiveCustomTheme"),
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) =>