mirror of
https://github.com/theoleuthardt/werkzeugkiste.git
synced 2026-06-13 09:37:53 +00:00
fix: no console log and error anymore
This commit is contained in:
parent
8fe6657200
commit
80daad2700
2 changed files with 60 additions and 47 deletions
|
|
@ -19,6 +19,8 @@ export default function DocConverter() {
|
|||
);
|
||||
|
||||
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (event.target.files && event.target.files.length > 0) {
|
||||
const selectedFile = event.target.files[0];
|
||||
const fileExtension = selectedFile.name.split(".").pop()?.toLowerCase();
|
||||
|
|
@ -28,7 +30,6 @@ export default function DocConverter() {
|
|||
);
|
||||
|
||||
if (!isSupported) {
|
||||
console.error("Not supported file uploaded!");
|
||||
alert("File format not supported!");
|
||||
event.target.value = "";
|
||||
return;
|
||||
|
|
@ -70,9 +71,7 @@ export default function DocConverter() {
|
|||
}
|
||||
|
||||
const blob = await response.blob();
|
||||
console.log("Blob:", blob);
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
console.log("Download URL:", url);
|
||||
setDownloadUrl(url);
|
||||
} catch (error) {
|
||||
console.error("Error while converting:", error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue