From 1f7085c307a6e58ab492651793ff4e94dc4b226d Mon Sep 17 00:00:00 2001 From: jellydeck <91427591+jellydeck@users.noreply.github.com> Date: Fri, 27 Mar 2026 12:30:59 +0530 Subject: [PATCH] chore: use logs for error --- src/lib/editor/Backgrounds.svelte | 11 +++++------ src/lib/editor/Navbar.svelte | 7 +------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/lib/editor/Backgrounds.svelte b/src/lib/editor/Backgrounds.svelte index 016f2cc..5b58e31 100644 --- a/src/lib/editor/Backgrounds.svelte +++ b/src/lib/editor/Backgrounds.svelte @@ -70,13 +70,13 @@ const handleImageUpload = (file: File) => { if (!['image/jpeg', 'image/png'].includes(file.type)) { - toast.error('Invalid file format! Please use JPG, PNG.'); + console.error('Invalid file format! Please use JPG, PNG.'); isDragOver = false; isDialogOpen = false; return; } if (file.size > MAX_FILE_SIZE) { - toast.error('File too large! Maximum size is 10MB.'); + console.error('File too large! Maximum size is 10MB.'); isDragOver = false; isDialogOpen = false; return; @@ -96,7 +96,7 @@ } }; reader.onerror = () => { - toast.error('Failed to read the file. Please try again.'); + console.error('Failed to read the file. Please try again.'); isDragOver = false; isDialogOpen = false; }; @@ -109,7 +109,7 @@ isDragOver = false; const file = e.dataTransfer?.files[0]; if (!file) { - toast.error('No valid file dropped.'); + console.error('No valid file dropped.'); isDialogOpen = false; } else { handleImageUpload(file); @@ -119,7 +119,7 @@ const handleFileInput = (e: Event) => { const file = (e.target as HTMLInputElement).files?.[0]; if (!file) { - toast.error('No file selected.'); + console.error('No file selected.'); isDialogOpen = false; } else { handleImageUpload(file); @@ -129,7 +129,6 @@ const handlePaste = (e: ClipboardEvent) => { const file = e.clipboardData?.files[0]; if (!file) { - toast.error('No valid image pasted.'); isDialogOpen = false; } else { handleImageUpload(file); diff --git a/src/lib/editor/Navbar.svelte b/src/lib/editor/Navbar.svelte index b59dff5..af7ec4e 100644 --- a/src/lib/editor/Navbar.svelte +++ b/src/lib/editor/Navbar.svelte @@ -59,16 +59,11 @@ } async function handleSingleExport() { - if (!uploadedImage) { - toast.error('Please upload an image first'); - return; - } isExporting = true; try { await exportImage(exportFormat, parseInt(quality)); - toast.success(`Successfully exported as ${exportFormat}!`); } catch { - toast.error('Failed to export image. Please try again.'); + console.error('Failed to export image. Please try again.'); } finally { isExporting = false; } -- 2.51.2