mirror of
https://github.com/upscayl/upscayl.git
synced 2026-04-25 03:00:05 -04:00
Update var
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import ELECTRON_COMMANDS from "@common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import { useEffect } from "react";
|
||||
import useLogger from "./use-logger";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from "react";
|
||||
import ELECTRON_COMMANDS from "@common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
|
||||
const useElectron = ({
|
||||
command,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import useLogger from "../hooks/use-logger";
|
||||
import { useState, useMemo } from "react";
|
||||
import ELECTRON_COMMANDS from "../../../common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import { useAtomValue, useSetAtom } from "jotai";
|
||||
import {
|
||||
batchModeAtom,
|
||||
@@ -149,7 +149,7 @@ const MainContent = ({
|
||||
} else {
|
||||
logit("🖼 Setting image path: ", filePath);
|
||||
setImagePath(filePath);
|
||||
var dirname = getDirectoryFromPath(filePath);
|
||||
const dirname = getDirectoryFromPath(filePath);
|
||||
logit("🗂 Setting output path: ", dirname);
|
||||
if (!FEATURE_FLAGS.APP_STORE_BUILD) {
|
||||
if (!rememberOutputFolder) {
|
||||
@@ -177,7 +177,7 @@ const MainContent = ({
|
||||
});
|
||||
} else {
|
||||
setImagePath(filePath);
|
||||
var dirname = getDirectoryFromPath(filePath);
|
||||
const dirname = getDirectoryFromPath(filePath);
|
||||
logit("🗂 Setting output path: ", dirname);
|
||||
if (!rememberOutputFolder) {
|
||||
setOutputPath(dirname);
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
|
||||
import UpscaylSVGLogo from "@/components/icons/upscayl-logo-svg";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { translationAtom } from "@/atoms/translations-atom";
|
||||
import ELECTRON_COMMANDS from "@common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import useLogger from "../hooks/use-logger";
|
||||
|
||||
function ProgressBar({
|
||||
|
||||
@@ -30,7 +30,7 @@ import Tabs from "../tabs";
|
||||
import Header from "../header";
|
||||
import { ChevronLeftIcon } from "lucide-react";
|
||||
import { logAtom } from "@/atoms/log-atom";
|
||||
import ELECTRON_COMMANDS from "@common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import useUpscaylVersion from "../hooks/use-upscayl-version";
|
||||
import useTranslation from "../hooks/use-translation";
|
||||
import UpscaylLogo from "./upscayl-logo";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import commands from "@common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { translationAtom } from "@/atoms/translations-atom";
|
||||
|
||||
@@ -32,12 +32,15 @@ export function CustomModelsFolderSelect({
|
||||
className="btn btn-primary"
|
||||
onClick={async () => {
|
||||
const customModelPath = await window.electron.invoke(
|
||||
commands.SELECT_CUSTOM_MODEL_FOLDER,
|
||||
ELECTRON_COMMANDS.SELECT_CUSTOM_MODEL_FOLDER,
|
||||
);
|
||||
|
||||
if (customModelPath !== null) {
|
||||
setCustomModelsPath(customModelPath);
|
||||
window.electron.send(commands.GET_MODELS_LIST, customModelPath);
|
||||
window.electron.send(
|
||||
ELECTRON_COMMANDS.GET_MODELS_LIST,
|
||||
customModelPath,
|
||||
);
|
||||
} else {
|
||||
setCustomModelsPath("");
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
useCustomWidthAtom,
|
||||
} from "../../../atoms/user-settings-atom";
|
||||
import { FEATURE_FLAGS } from "@common/feature-flags";
|
||||
import ELECTRON_COMMANDS from "@common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import Select from "react-select";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
@@ -75,7 +75,7 @@ function UpscaylSteps({
|
||||
const t = useAtomValue(translationAtom);
|
||||
|
||||
const outputHandler = async () => {
|
||||
var path = await window.electron.invoke(ELECTRON_COMMANDS.SELECT_FOLDER);
|
||||
const path = await window.electron.invoke(ELECTRON_COMMANDS.SELECT_FOLDER);
|
||||
if (path !== null) {
|
||||
logit("🗂 Setting Output Path: ", path);
|
||||
setOutputPath(path);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
import { useState, useEffect } from "react";
|
||||
import ELECTRON_COMMANDS from "../../common/commands";
|
||||
import { ELECTRON_COMMANDS } from "@common/electron-commands";
|
||||
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||
import { modelsListAtom } from "../atoms/models-list-atom";
|
||||
import {
|
||||
@@ -54,11 +54,11 @@ const Home = () => {
|
||||
|
||||
const selectImageHandler = async () => {
|
||||
resetImagePaths();
|
||||
var path = await window.electron.invoke(ELECTRON_COMMANDS.SELECT_FILE);
|
||||
const path = await window.electron.invoke(ELECTRON_COMMANDS.SELECT_FILE);
|
||||
if (path === null) return;
|
||||
logit("🖼 Selected Image Path: ", path);
|
||||
setImagePath(path);
|
||||
var dirname = getDirectoryFromPath(path);
|
||||
const dirname = getDirectoryFromPath(path);
|
||||
logit("📁 Selected Image Directory: ", dirname);
|
||||
if (!FEATURE_FLAGS.APP_STORE_BUILD) {
|
||||
if (!rememberOutputFolder) {
|
||||
@@ -70,7 +70,7 @@ const Home = () => {
|
||||
|
||||
const selectFolderHandler = async () => {
|
||||
resetImagePaths();
|
||||
var path = await window.electron.invoke(ELECTRON_COMMANDS.SELECT_FOLDER);
|
||||
const path = await window.electron.invoke(ELECTRON_COMMANDS.SELECT_FOLDER);
|
||||
if (path !== null) {
|
||||
logit("🖼 Selected Folder Path: ", path);
|
||||
setBatchFolderPath(path);
|
||||
|
||||
Reference in New Issue
Block a user