1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-23 23:21:05 +01:00

Change outputfolder name

This commit is contained in:
Feenix 2023-04-21 00:04:49 +05:30
parent 6bcb42791b
commit 7b47287035
5 changed files with 28 additions and 15 deletions

14
package-lock.json generated
View File

@ -35,7 +35,7 @@
"@types/react-dom": "^18.0.8",
"autoprefixer": "^10.4.13",
"cross-env": "^7.0.3",
"electron": "^23.1.4",
"electron": "^23.2.4",
"electron-builder": "^24.0.0",
"next": "^13.0.2",
"postcss": "^8.4.18",
@ -3221,9 +3221,9 @@
}
},
"node_modules/electron": {
"version": "23.1.4",
"resolved": "https://registry.npmjs.org/electron/-/electron-23.1.4.tgz",
"integrity": "sha512-3Z6CpAPdhv6haYX9DTO7k0l6uAUreZM3/EngQYqGN3Gz7Fp0DPb/egt8BwR3ClG/jTlQM+PQ+5WkTK0eMjm07A==",
"version": "23.2.4",
"resolved": "https://registry.npmjs.org/electron/-/electron-23.2.4.tgz",
"integrity": "sha512-ceFd+KIhzK3srGY22kcBu8QH7hV1G3DHlgrg2LGjg7mgtzxlXeyKzk2Efq0iFNu3ly14QKfiN5gYdvEenmzOAA==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
@ -10047,9 +10047,9 @@
}
},
"electron": {
"version": "23.1.4",
"resolved": "https://registry.npmjs.org/electron/-/electron-23.1.4.tgz",
"integrity": "sha512-3Z6CpAPdhv6haYX9DTO7k0l6uAUreZM3/EngQYqGN3Gz7Fp0DPb/egt8BwR3ClG/jTlQM+PQ+5WkTK0eMjm07A==",
"version": "23.2.4",
"resolved": "https://registry.npmjs.org/electron/-/electron-23.2.4.tgz",
"integrity": "sha512-ceFd+KIhzK3srGY22kcBu8QH7hV1G3DHlgrg2LGjg7mgtzxlXeyKzk2Efq0iFNu3ly14QKfiN5gYdvEenmzOAA==",
"dev": true,
"requires": {
"@electron/get": "^2.0.0",

View File

@ -143,7 +143,7 @@
"@types/react-dom": "^18.0.8",
"autoprefixer": "^10.4.13",
"cross-env": "^7.0.3",
"electron": "^23.1.4",
"electron": "^23.2.4",
"electron-builder": "^24.0.0",
"next": "^13.0.2",
"postcss": "^8.4.18",

View File

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

View File

@ -4,8 +4,8 @@ import commands from "../../electron/commands";
import { useAtom } from "jotai";
import {
customModelsPathAtom,
rememberOutputFolderAtom,
scaleAtom,
saveOutputFolderAtom,
} from "../atoms/userSettingsAtom";
import { modelsListAtom } from "../atoms/modelsListAtom";
@ -45,7 +45,9 @@ function SettingsTab({
const [customModelsPath, setCustomModelsPath] = useAtom(customModelsPathAtom);
const [modelOptions, setModelOptions] = useAtom(modelsListAtom);
const [saveOutputFolder, setSaveOutputFolder] = useAtom(saveOutputFolderAtom);
const [rememberOutputFolder, setRememberOutputFolder] = useAtom(
rememberOutputFolderAtom
);
const [scale, setScale] = useAtom(scaleAtom);
@ -156,9 +158,9 @@ function SettingsTab({
<input
type="checkbox"
className="toggle-primary toggle"
defaultChecked={saveOutputFolder}
onClick={() => {
setSaveOutputFolder((oldValue) => !oldValue);
defaultChecked={rememberOutputFolder}
onChange={() => {
setRememberOutputFolder((oldValue) => !oldValue);
}}
/>
</div>

View File

@ -337,6 +337,14 @@ const Home = () => {
e.preventDefault();
resetImagePaths();
if (
e.dataTransfer.items.length === 0 ||
e.dataTransfer.files.length === 0
) {
alert("Please drag and drop an image");
return;
}
const type = e.dataTransfer.items[0].type;
console.log("🚀 => handleDrop => type", type);
const filePath = e.dataTransfer.files[0].path;