chore: add reinstall plugins CTA
This commit is contained in:
parent
91d49d1fe6
commit
b8b7c416c7
@ -147,6 +147,18 @@ function handleIPCs() {
|
|||||||
ipcMain.handle("relaunch", async (_event, url) => {
|
ipcMain.handle("relaunch", async (_event, url) => {
|
||||||
dispose(requiredModules);
|
dispose(requiredModules);
|
||||||
app.relaunch();
|
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();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -13,6 +13,8 @@ contextBridge.exposeInMainWorld("electronAPI", {
|
|||||||
|
|
||||||
pluginPath: () => ipcRenderer.invoke("pluginPath"),
|
pluginPath: () => ipcRenderer.invoke("pluginPath"),
|
||||||
|
|
||||||
|
reloadPlugins: () => ipcRenderer.invoke("reloadPlugins"),
|
||||||
|
|
||||||
appVersion: () => ipcRenderer.invoke("appVersion"),
|
appVersion: () => ipcRenderer.invoke("appVersion"),
|
||||||
|
|
||||||
openExternalUrl: (url: string) => ipcRenderer.invoke("openExternalUrl", url),
|
openExternalUrl: (url: string) => ipcRenderer.invoke("openExternalUrl", url),
|
||||||
|
|||||||
@ -172,15 +172,30 @@ export const Preferences = () => {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<div className="flex flex-col space-y-2">
|
||||||
type="submit"
|
<button
|
||||||
className={classNames(
|
type="submit"
|
||||||
"rounded-md px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",
|
className={classNames(
|
||||||
fileName ? "bg-indigo-600 hover:bg-indigo-500" : "bg-gray-500"
|
"rounded-md px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",
|
||||||
)}
|
fileName
|
||||||
>
|
? "bg-blue-500 hover:bg-blue-300"
|
||||||
Install Plugin
|
: "bg-gray-500"
|
||||||
</button>
|
)}
|
||||||
|
>
|
||||||
|
Install Plugin
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
className={classNames(
|
||||||
|
"bg-blue-500 hover:bg-blue-300 rounded-md px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
||||||
|
)}
|
||||||
|
onClick={() => {
|
||||||
|
window.electronAPI.reloadPlugins();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Reload Plugins
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user