mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
Fix duplicate on crop
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
parent
7624cb2b3d
commit
43e09d4724
@ -11,12 +11,15 @@ const CardAsset = styled(Flex)`
|
|||||||
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
||||||
background: linear-gradient(180deg, #ffffff 0%, #f6f6f9 121.48%);
|
background: linear-gradient(180deg, #ffffff 0%, #f6f6f9 121.48%);
|
||||||
`;
|
`;
|
||||||
|
const Img = styled.img``;
|
||||||
|
|
||||||
export const AssetPreview = forwardRef(({ mime, url, name }, ref) => {
|
export const AssetPreview = forwardRef(({ mime, url, name }, ref) => {
|
||||||
const [lang] = usePersistentState('strapi-admin-language', 'en');
|
const [lang] = usePersistentState('strapi-admin-language', 'en');
|
||||||
|
|
||||||
if (mime.includes(AssetType.Image)) {
|
if (mime.includes(AssetType.Image)) {
|
||||||
return <img ref={ref} src={url} alt={name} />;
|
console.log(mime);
|
||||||
|
|
||||||
|
return <Img ref={ref} src={url} alt={name} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mime.includes(AssetType.Video)) {
|
if (mime.includes(AssetType.Video)) {
|
||||||
|
@ -114,7 +114,7 @@ export const PreviewBox = ({
|
|||||||
const nextAsset = { ...asset, width, height };
|
const nextAsset = { ...asset, width, height };
|
||||||
const file = await produceFile(nextAsset.name, nextAsset.mime, nextAsset.updatedAt);
|
const file = await produceFile(nextAsset.name, nextAsset.mime, nextAsset.updatedAt);
|
||||||
|
|
||||||
await upload(file);
|
await upload({ name: file.name, rawFile: file });
|
||||||
|
|
||||||
trackUsage('didCropFile', { duplicatedFile: true, location: trackedLocation });
|
trackUsage('didCropFile', { duplicatedFile: true, location: trackedLocation });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user