diff --git a/electron/main.ts b/electron/main.ts index 058afd835..ca5d9f187 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -147,6 +147,18 @@ function handleIPCs() { ipcMain.handle("relaunch", async (_event, url) => { dispose(requiredModules); app.relaunch(); + app.exit(); + }); + + ipcMain.handle("reloadPlugins", async (_event, url) => { + const userDataPath = app.getPath("userData"); + const fullPath = join(userDataPath, "plugins"); + + rmdir(fullPath, { recursive: true }, function (err) { + if (err) console.log(err); + app.relaunch(); + app.exit(); + }); }); /** diff --git a/electron/preload.ts b/electron/preload.ts index c3dd73646..7ccc6174d 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -13,6 +13,8 @@ contextBridge.exposeInMainWorld("electronAPI", { pluginPath: () => ipcRenderer.invoke("pluginPath"), + reloadPlugins: () => ipcRenderer.invoke("reloadPlugins"), + appVersion: () => ipcRenderer.invoke("appVersion"), openExternalUrl: (url: string) => ipcRenderer.invoke("openExternalUrl", url), diff --git a/web/app/_components/Preferences.tsx b/web/app/_components/Preferences.tsx index 3144339f6..0d311aa9b 100644 --- a/web/app/_components/Preferences.tsx +++ b/web/app/_components/Preferences.tsx @@ -172,15 +172,30 @@ export const Preferences = () => { /> - +