Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix bug with trying to upload the same file again after the `src` gets set to something else

Tim Wilsonfa31b5d32ef4
diff --git a/apps/web/ui/modals/add-edit-link-modal/preview.tsx b/apps/web/ui/modals/add-edit-link-modal/preview.tsx
index b209f97a88..7d8f9c83a2 100644
--- a/apps/web/ui/modals/add-edit-link-modal/preview.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/preview.tsx
@@ -292,6 +292,7 @@ const ImagePreview = ({
</div>
</Popover>
<input
+ key={image}
ref={inputFileRef}
onChange={onInputFileChange}
type="file"
diff --git a/packages/ui/src/image-upload.tsx b/packages/ui/src/image-upload.tsx
index b73a312610..5c030f4e3e 100644
--- a/packages/ui/src/image-upload.tsx
+++ b/packages/ui/src/image-upload.tsx
@@ -199,8 +199,8 @@ export function ImageUpload({
{clickToUpload && (
<div className="sr-only mt-1 flex shadow-sm">
<input
+ key={src}
id={inputId}
- name="image"
type="file"
accept="image/*"
onChange={onImageChange}