1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-17 11:18:36 +01:00

fixed overwrite setting not being read

This commit is contained in:
TGS963 2023-08-27 21:41:01 +05:30
parent d25f703766
commit b7c876bbe5
3 changed files with 3 additions and 10 deletions

View File

@ -164,15 +164,6 @@ app.on("ready", async () => {
quality = parseInt(overwriteToggle);
}
});
// GET OVERWRITE SETTINGS FROM LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("overwrite");', true)
.then((lastSavedOverwrite: boolean | null) => {
if (lastSavedOverwrite !== null) {
overwrite = lastSavedOverwrite;
}
});
mainWindow.webContents.send(commands.OS, getPlatform());
});
@ -379,6 +370,7 @@ ipcMain.handle(commands.SELECT_CUSTOM_MODEL_FOLDER, async (event, message) => {
//------------------------Image Upscayl-----------------------------//
ipcMain.on(commands.UPSCAYL, async (event, payload) => {
if (!mainWindow) return;
overwrite = payload.overwrite;
const model = payload.model as string;
const gpuId = payload.gpuId as string;
const saveImageAs = payload.saveImageAs as string;

View File

@ -10,7 +10,7 @@ const ToggleOverwrite = ({ overwrite, setOverwrite }: ToggleOverwriteProps) => {
if (!localStorage.getItem("overwrite")) {
localStorage.setItem("overwrite", JSON.stringify(overwrite));
} else {
setOverwrite(localStorage.getItem("overwrite"));
setOverwrite(localStorage.getItem("overwrite") === 'true');
}
}, []);
return (

View File

@ -407,6 +407,7 @@ const Home = () => {
gpuId: gpuId.length === 0 ? null : gpuId,
saveImageAs,
scale,
overwrite,
});
logit("🏁 UPSCAYL");
}