From 6f8884edbce6921d6a9094cccd0af97bd0d7b849 Mon Sep 17 00:00:00 2001 From: Nehal Sharma <68962290+N-Shar-ma@users.noreply.github.com> Date: Mon, 31 May 2021 11:23:39 -0700 Subject: [PATCH 1/2] Bug Fix: PDF files can only be merged, other format options should not show in Output dropdown ## Problem: Currently, when PDF files were selected, other image formats still showed up as conversion options. Chosing them would make nothing happen, so no error, but giving false options is bad UX ## Solution: When a PDF file is selected, user only is only shown the PDF option to merge them --- src/pages/MediaManip/DragDrop/DragDrop.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/MediaManip/DragDrop/DragDrop.jsx b/src/pages/MediaManip/DragDrop/DragDrop.jsx index d2eef137..443382bb 100644 --- a/src/pages/MediaManip/DragDrop/DragDrop.jsx +++ b/src/pages/MediaManip/DragDrop/DragDrop.jsx @@ -27,7 +27,7 @@ function DragDrop(props) { outputOptionsTemp.splice(index, 1); setOutputOptions(outputOptionsTemp); } - + if(fileType === "pdf") setOutputOptions(["pdf"]); return Object.assign(file, { preview: URL.createObjectURL(file), }); From 514c646b385a30a273ad73c116640efee02fde7a Mon Sep 17 00:00:00 2001 From: smaranjitghose Date: Tue, 1 Jun 2021 09:51:58 +0000 Subject: [PATCH 2/2] Prettified Code! --- src/pages/MediaManip/DragDrop/DragDrop.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/MediaManip/DragDrop/DragDrop.jsx b/src/pages/MediaManip/DragDrop/DragDrop.jsx index 443382bb..e68095cc 100644 --- a/src/pages/MediaManip/DragDrop/DragDrop.jsx +++ b/src/pages/MediaManip/DragDrop/DragDrop.jsx @@ -27,7 +27,7 @@ function DragDrop(props) { outputOptionsTemp.splice(index, 1); setOutputOptions(outputOptionsTemp); } - if(fileType === "pdf") setOutputOptions(["pdf"]); + if (fileType === "pdf") setOutputOptions(["pdf"]); return Object.assign(file, { preview: URL.createObjectURL(file), });