mirror of
https://github.com/strapi/strapi.git
synced 2025-09-28 18:01:26 +00:00
Fix ref edit
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
e70a40931b
commit
ade27c830f
@ -58,7 +58,9 @@ const EditForm = forwardRef(
|
|||||||
const cacheRef = useRef(performance.now());
|
const cacheRef = useRef(performance.now());
|
||||||
|
|
||||||
const fileURL = get(fileToEdit, ['file', 'url'], null);
|
const fileURL = get(fileToEdit, ['file', 'url'], null);
|
||||||
const prefixedFileURL = fileURL ? prefixFileUrlWithBackendUrl(fileURL) : null;
|
const prefixedFileURL = fileURL
|
||||||
|
? prefixFileUrlWithBackendUrl(`${fileURL}?${cacheRef.current}`)
|
||||||
|
: null;
|
||||||
const downloadFileName = createFileToDownloadName(fileToEdit);
|
const downloadFileName = createFileToDownloadName(fileToEdit);
|
||||||
const mimeType =
|
const mimeType =
|
||||||
get(fileToEdit, ['file', 'type'], null) || get(fileToEdit, ['file', 'mime'], '');
|
get(fileToEdit, ['file', 'type'], null) || get(fileToEdit, ['file', 'mime'], '');
|
||||||
@ -284,7 +286,7 @@ const EditForm = forwardRef(
|
|||||||
{isImg ? (
|
{isImg ? (
|
||||||
<CropWrapper>
|
<CropWrapper>
|
||||||
<img
|
<img
|
||||||
src={`${src}?${cacheRef.current}`}
|
src={src}
|
||||||
alt={get(fileToEdit, ['file', 'name'], '')}
|
alt={get(fileToEdit, ['file', 'name'], '')}
|
||||||
ref={isCropping ? imgRef : null}
|
ref={isCropping ? imgRef : null}
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user