Add option to reset cache

This commit is contained in:
TC
2021-02-06 22:15:57 +01:00
parent d6f7c54370
commit 3976d1c862
3 changed files with 14 additions and 0 deletions

View File

@ -13,6 +13,7 @@ const defaultConfig = {
disableHardwareAcceleration: false,
restartOnConfigChanges: false,
trayClickPlayPause: false,
autoResetAppCache: false,
},
plugins: {
// Enabled plugins

View File

@ -196,6 +196,11 @@ app.on("activate", () => {
});
app.on("ready", () => {
if (config.get("options.autoResetAppCache")) {
// Clear cache
electron.session.defaultSession.clearCache();
}
mainWindow = createMainWindow();
setApplicationMenu(mainWindow);
if (config.get("options.restartOnConfigChanges")) {

View File

@ -58,6 +58,14 @@ const mainMenuTemplate = (win) => [
config.set("options.restartOnConfigChanges", item.checked);
},
},
{
label: "Reset App cache when app starts",
type: "checkbox",
checked: config.get("options.autoResetAppCache"),
click: (item) => {
config.set("options.autoResetAppCache", item.checked);
},
},
...(is.windows() || is.linux()
? [
{