Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Forward clearElectronStore

Manav Rathi83477cfe377d
diff --git a/desktop/src/preload.ts b/desktop/src/preload.ts
index a0cbec7f13..8b7ae59ea3 100644
--- a/desktop/src/preload.ts
+++ b/desktop/src/preload.ts
@@ -34,7 +34,6 @@ import * as fs from "promise-fs";
import { Readable } from "stream";
import { deleteDiskCache, openDiskCache } from "./api/cache";
import { logToDisk, openLogDirectory } from "./api/common";
-import { clearElectronStore } from "./api/electronStore";
import {
checkExistsAndCreateDir,
exists,
@@ -332,6 +331,12 @@ const openDirectory = async (dirPath: string): Promise<void> => {
// -
+const clearElectronStore = () => {
+ ipcRenderer.send("clear-electron-store");
+};
+
+// -
+
const updateAndRestart = () => {
ipcRenderer.send("update-and-restart");
};
diff --git a/desktop/src/utils/ipcComms.ts b/desktop/src/utils/ipcComms.ts
index 83dafeb783..861cec75e8 100644
--- a/desktop/src/utils/ipcComms.ts
+++ b/desktop/src/utils/ipcComms.ts
@@ -9,6 +9,7 @@ import {
Tray,
} from "electron";
import path from "path";
+import { clearElectronStore } from "../api/electronStore";
import {
getAppVersion,
muteUpdateNotification,
@@ -90,6 +91,10 @@ export default function setupIpcComs(
return safeStorage.decryptString(message);
});
+ ipcMain.on("clear-electron-store", () => {
+ clearElectronStore();
+ });
+
ipcMain.handle("get-path", (_, message) => {
// By default, these paths are at the following locations:
//