1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-03 05:07:14 +01:00
upscayl/renderer/atoms/user-settings-atom.ts

79 lines
2.0 KiB
TypeScript
Raw Normal View History

2024-10-06 12:45:44 +05:30
import { ImageFormat } from "@/lib/valid-formats";
import { ModelId } from "@common/models-list";
2023-09-09 16:33:16 +05:30
import { atom } from "jotai";
2023-04-09 10:46:15 +05:30
import { atomWithStorage } from "jotai/utils";
export const customModelsPathAtom = atomWithStorage<string | null>(
"customModelsPath",
2024-02-08 20:27:35 +05:30
null,
2023-04-09 10:46:15 +05:30
);
2024-04-09 23:41:24 +05:30
2024-10-06 12:45:44 +05:30
export const selectedModelIdAtom = atomWithStorage<ModelId | string>(
"selectedModelId",
2024-10-30 19:03:41 +05:30
"upscayl-standard-4x",
2024-10-06 12:45:44 +05:30
);
2024-10-30 19:03:41 +05:30
export const doubleUpscaylAtom = atomWithStorage("doubleUpscayl", false);
2024-10-06 12:45:44 +05:30
export const gpuIdAtom = atomWithStorage("gpuId", "");
export const saveImageAsAtom = atomWithStorage<ImageFormat>(
"saveImageAs",
"png",
);
2024-04-21 22:57:16 +05:30
export const scaleAtom = atomWithStorage<string>("scale", "4");
2024-04-09 23:41:24 +05:30
2023-09-09 16:33:16 +05:30
export const batchModeAtom = atom<boolean>(false);
2024-04-09 23:41:24 +05:30
/**
* The path to the last folder the user saved an image to.
* Reset to "" if rememberOutputFolder is false.
*/
2024-04-09 23:41:24 +05:30
export const savedOutputPathAtom = atomWithStorage<string | null>(
"savedOutputPath",
2024-02-14 12:02:52 +05:30
null,
);
2024-04-09 23:41:24 +05:30
2023-11-10 17:11:35 +05:30
export const progressAtom = atom<string>("");
2023-04-21 00:04:49 +05:30
export const rememberOutputFolderAtom = atomWithStorage<boolean>(
"rememberOutputFolder",
2024-02-08 20:27:35 +05:30
false,
2023-04-21 00:04:49 +05:30
);
2023-09-03 14:46:48 +05:30
export const dontShowCloudModalAtom = atomWithStorage<boolean>(
"dontShowCloudModal",
2024-02-08 20:27:35 +05:30
false,
2023-09-03 14:46:48 +05:30
);
2023-09-19 00:00:43 +05:30
export const noImageProcessingAtom = atomWithStorage<boolean>(
"noImageProcessing",
2024-02-08 20:27:35 +05:30
false,
2023-09-19 00:00:43 +05:30
);
2023-11-22 21:27:44 +05:30
export const compressionAtom = atomWithStorage<number>("compression", 0);
export const overwriteAtom = atomWithStorage("overwrite", false);
2024-01-16 13:03:43 +05:30
export const turnOffNotificationsAtom = atomWithStorage(
"turnOffNotifications",
2024-02-08 20:27:35 +05:30
false,
2024-01-16 13:03:43 +05:30
);
2024-01-23 14:14:32 +05:30
export const viewTypeAtom = atomWithStorage<"slider" | "lens">(
"viewType",
2024-04-01 14:34:56 +05:30
"slider",
2024-01-23 14:14:32 +05:30
);
export const lensSizeAtom = atomWithStorage<number>("lensSize", 100);
2024-02-08 20:27:35 +05:30
export const customWidthAtom = atomWithStorage<number>("customWidth", 0);
2024-02-08 20:27:35 +05:30
export const useCustomWidthAtom = atomWithStorage<boolean>(
"useCustomWidth",
false,
);
2024-04-17 21:48:45 +05:30
export const tileSizeAtom = atomWithStorage<number | null>("tileSize", null);
2024-04-17 21:48:45 +05:30
// CLIENT SIDE ONLY
export const showSidebarAtom = atomWithStorage("showSidebar", true);