🐛 Fix new image upload refresh when URL is the same
We now add a `v` query param containing the timestamp to make sure each newly created file URL is unique
This commit is contained in:
@@ -31,7 +31,7 @@ export const UploadButton = ({
|
||||
},
|
||||
],
|
||||
})
|
||||
if (urls.length && urls[0]) onFileUploaded(urls[0])
|
||||
if (urls.length && urls[0]) onFileUploaded(urls[0] + '?v=' + Date.now())
|
||||
setIsUploading(false)
|
||||
}
|
||||
|
||||
@@ -43,9 +43,7 @@ export const UploadButton = ({
|
||||
id="file-input"
|
||||
display="none"
|
||||
onChange={handleInputChange}
|
||||
accept={
|
||||
fileType === 'image' ? '.jpg, .jpeg, .png, .svg, .gif' : '.mp3, .wav'
|
||||
}
|
||||
accept={fileType === 'image' ? '.jpg, .jpeg, .png, .gif' : '.mp3, .wav'}
|
||||
/>
|
||||
<Button
|
||||
as="label"
|
||||
|
||||
Reference in New Issue
Block a user