mirror of
https://github.com/upscayl/upscayl.git
synced 2024-09-24 11:28:25 +02:00
Fixed non-image bug
This commit is contained in:
parent
ac51ad1a67
commit
ce74ee0c68
@ -3,9 +3,15 @@ import React from "react";
|
|||||||
function RightPaneInfo({ version, batchMode }) {
|
function RightPaneInfo({ version, batchMode }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p className="p-5 text-lg font-medium text-neutral-400">
|
<p className="p-5 pb-0 text-lg font-medium text-neutral-400">
|
||||||
Select {batchMode ? "a Folder" : "an Image"} to Upscale
|
Select {batchMode ? "a Folder" : "an Image"} to Upscale
|
||||||
</p>
|
</p>
|
||||||
|
{batchMode && (
|
||||||
|
<p className="w-full py-5 text-center text-neutral-500 md:w-96">
|
||||||
|
Make sure that the folder doesn't contain anything except PNG, JPG,
|
||||||
|
JPEG & WEBP images.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<p className="text-neutral-600">Upscayl v{version}</p>
|
<p className="text-neutral-600">Upscayl v{version}</p>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -103,6 +103,27 @@ const Home = () => {
|
|||||||
setProgress("");
|
setProgress("");
|
||||||
}, [batchMode]);
|
}, [batchMode]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (imagePath.length > 0) {
|
||||||
|
const filePath = imagePath;
|
||||||
|
console.log(
|
||||||
|
"🚀 => file: index.jsx => line 109 => useEffect => filePath",
|
||||||
|
filePath
|
||||||
|
);
|
||||||
|
|
||||||
|
const extension = imagePath.toLocaleLowerCase().split(".").pop();
|
||||||
|
console.log(
|
||||||
|
"🚀 => file: index.jsx => line 111 => useEffect => extension",
|
||||||
|
extension
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!allowedFileTypes.includes(extension.toLowerCase())) {
|
||||||
|
alert("Please select an image");
|
||||||
|
resetImagePaths();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [imagePath]);
|
||||||
|
|
||||||
const selectImageHandler = async () => {
|
const selectImageHandler = async () => {
|
||||||
resetImagePaths();
|
resetImagePaths();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user