diff --git a/electron/index.ts b/electron/index.ts
index 4b88954..67f0ae4 100644
--- a/electron/index.ts
+++ b/electron/index.ts
@@ -1,10 +1,8 @@
import {
getBatchArguments,
- getBatchSharpenArguments,
getDoubleUpscaleArguments,
getDoubleUpscaleSecondPassArguments,
getSingleImageArguments,
- getSingleImageSharpenArguments,
} from "./utils/getArguments";
// Native
import { autoUpdater } from "electron-updater";
@@ -218,6 +216,14 @@ ipcMain.handle(commands.SELECT_FOLDER, async (event, message) => {
} else {
logit("Selected Folder Path: ", folderPaths[0]);
folderPath = folderPaths[0];
+ mainWindow.webContents
+ .executeJavaScript(
+ `localStorage.setItem("lastImagePath", "${folderPath}");`,
+ true
+ )
+ .then(() => {
+ logit(`Saved Last Image Path (${folderPath}) to Local Storage`);
+ });
return folderPaths[0];
}
});
diff --git a/renderer/atoms/userSettingsAtom.ts b/renderer/atoms/userSettingsAtom.ts
index a33e698..fec7436 100644
--- a/renderer/atoms/userSettingsAtom.ts
+++ b/renderer/atoms/userSettingsAtom.ts
@@ -7,4 +7,6 @@ export const customModelsPathAtom = atomWithStorage
By{" "} + target="_blank"> TGS963 {" "} and{" "} + target="_blank"> Nayam Amarshe
diff --git a/renderer/components/SettingsTab.tsx b/renderer/components/SettingsTab.tsx index fe23ff8..1ecc1c7 100644 --- a/renderer/components/SettingsTab.tsx +++ b/renderer/components/SettingsTab.tsx @@ -1,13 +1,13 @@ import React, { useEffect, useState } from "react"; -import Select from "react-select"; -import ReactTooltip from "react-tooltip"; import { themeChange } from "theme-change"; -import log from "electron-log/renderer"; import commands from "../../electron/commands"; import { useAtom } from "jotai"; -import { customModelsPathAtom, scaleAtom } from "../atoms/userSettingsAtom"; -import { TModelsList, modelsListAtom } from "../atoms/modelsListAtom"; -import { atomWithStorage } from "jotai/utils"; +import { + customModelsPathAtom, + scaleAtom, + saveOutputFolderAtom, +} from "../atoms/userSettingsAtom"; +import { modelsListAtom } from "../atoms/modelsListAtom"; interface IProps { batchMode: boolean; @@ -42,9 +42,10 @@ function SettingsTab({ }); const [isCopied, setIsCopied] = useState(false); + const [customModelsPath, setCustomModelsPath] = useAtom(customModelsPathAtom); - const [customModelOptions, setCustomModelOptions] = useStateUPSCAYL THEME
+ +SAVE OUTPUT FOLDER (PERMANENTLY)
+ { + setSaveOutputFolder((oldValue) => !oldValue); + }} + /> +GPU ID
+ +ADD CUSTOM MODELS
+{customModelsPath}
+ +UPSCAYL THEME
- -GPU ID
- -ADD CUSTOM MODELS
-{customModelsPath}
- -IMAGE SCALE