1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-28 01:10:52 +01:00

Add batch mode localstorage

This commit is contained in:
Feenix 2023-04-15 09:26:40 +05:30
parent 3865e1fed0
commit 58c6e8f9ec
4 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "upscayl", "name": "upscayl",
"private": true, "private": true,
"version": "2.0.1", "version": "2.5.0",
"productName": "Upscayl", "productName": "Upscayl",
"homepage": "https://github.com/TGS963/upscayl", "homepage": "https://github.com/TGS963/upscayl",
"contributors": [ "contributors": [

View File

@ -6,3 +6,5 @@ export const customModelsPathAtom = atomWithStorage<string | null>(
); );
export const scaleAtom = atomWithStorage<"2" | "3" | "4">("scale", "4"); export const scaleAtom = atomWithStorage<"2" | "3" | "4">("scale", "4");
export const batchModeAtom = atomWithStorage<boolean>("batchMode", false);

View File

@ -175,6 +175,7 @@ function LeftPaneImageSteps({
<input <input
type="checkbox" type="checkbox"
className="toggle" className="toggle"
checked={batchMode}
onClick={handleBatchMode}></input> onClick={handleBatchMode}></input>
<p <p
className="mr-1 inline-block cursor-help text-sm" className="mr-1 inline-block cursor-help text-sm"

View File

@ -12,7 +12,11 @@ import SettingsTab from "../components/SettingsTab";
import { useAtom } from "jotai"; import { useAtom } from "jotai";
import { logAtom } from "../atoms/logAtom"; import { logAtom } from "../atoms/logAtom";
import { modelsListAtom } from "../atoms/modelsListAtom"; import { modelsListAtom } from "../atoms/modelsListAtom";
import { customModelsPathAtom, scaleAtom } from "../atoms/userSettingsAtom"; import {
batchModeAtom,
customModelsPathAtom,
scaleAtom,
} from "../atoms/userSettingsAtom";
const Home = () => { const Home = () => {
// STATES // STATES
@ -24,7 +28,7 @@ const Home = () => {
const [model, setModel] = useState("realesrgan-x4plus"); const [model, setModel] = useState("realesrgan-x4plus");
const [loaded, setLoaded] = useState(false); const [loaded, setLoaded] = useState(false);
const [version, setVersion] = useState(""); const [version, setVersion] = useState("");
const [batchMode, setBatchMode] = useState(false); const [batchMode, setBatchMode] = useAtom(batchModeAtom);
const [batchFolderPath, setBatchFolderPath] = useState(""); const [batchFolderPath, setBatchFolderPath] = useState("");
const [upscaledBatchFolderPath, setUpscaledBatchFolderPath] = useState(""); const [upscaledBatchFolderPath, setUpscaledBatchFolderPath] = useState("");
const [doubleUpscayl, setDoubleUpscayl] = useState(false); const [doubleUpscayl, setDoubleUpscayl] = useState(false);