From 37405cac60c3ec770051196c0407d494a865f73d Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sat, 7 Aug 2021 10:19:31 +1000 Subject: [PATCH] Fix issue with drag and drop tokens from a url not loading --- src/hooks/useImageDrop.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hooks/useImageDrop.ts b/src/hooks/useImageDrop.ts index 590f72f..dde5616 100644 --- a/src/hooks/useImageDrop.ts +++ b/src/hooks/useImageDrop.ts @@ -56,7 +56,10 @@ function useImageDrop( } const response = await fetch(url); if (response.ok) { - const file = new File([await response.blob()], name); + const blob = await response.blob(); + const file = new File([blob], name, { + type: blob.type, + }); if (supportFileTypes.includes(file.type)) { imageFiles.push(file); } else {