Fix clear storage not working

It failed because it went looking for the focused / first window to
clear the storage on, but we called it before we had a window. Just
rewrite it without electron-clear-storage which doesn't really seem
necessary as a dependency, and also relaunched the app when clearing
stprage (you-had-one-job.gif). Pass the session in explicitly so it's
clear it needs it.
This commit is contained in:
David Baker
2025-06-04 16:01:03 +01:00
parent cf88e520a0
commit 6901bff548
5 changed files with 38 additions and 30 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
break;
case "clearStorage":
await clearDataAndRelaunch();
await clearDataAndRelaunch(global.mainWindow.webContents.session);
return; // the app is about to stop, we don't need to reply to the IPC
case "breadcrumbs": {