1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-27 17:00: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",
"private": true,
"version": "2.0.1",
"version": "2.5.0",
"productName": "Upscayl",
"homepage": "https://github.com/TGS963/upscayl",
"contributors": [

View File

@ -6,3 +6,5 @@ export const customModelsPathAtom = atomWithStorage<string | null>(
);
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
type="checkbox"
className="toggle"
checked={batchMode}
onClick={handleBatchMode}></input>
<p
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 { logAtom } from "../atoms/logAtom";
import { modelsListAtom } from "../atoms/modelsListAtom";
import { customModelsPathAtom, scaleAtom } from "../atoms/userSettingsAtom";
import {
batchModeAtom,
customModelsPathAtom,
scaleAtom,
} from "../atoms/userSettingsAtom";
const Home = () => {
// STATES
@ -24,7 +28,7 @@ const Home = () => {
const [model, setModel] = useState("realesrgan-x4plus");
const [loaded, setLoaded] = useState(false);
const [version, setVersion] = useState("");
const [batchMode, setBatchMode] = useState(false);
const [batchMode, setBatchMode] = useAtom(batchModeAtom);
const [batchFolderPath, setBatchFolderPath] = useState("");
const [upscaledBatchFolderPath, setUpscaledBatchFolderPath] = useState("");
const [doubleUpscayl, setDoubleUpscayl] = useState(false);