-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: path upload plugin to fix URL issue (#40)
- Loading branch information
Showing
3 changed files
with
208 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/node_modules/@strapi/plugin-upload/admin/src/components/AssetCard/ImageAssetCard.js b/node_modules/@strapi/plugin-upload/admin/src/components/AssetCard/ImageAssetCard.js | ||
index a390077..19722a1 100644 | ||
--- a/node_modules/@strapi/plugin-upload/admin/src/components/AssetCard/ImageAssetCard.js | ||
+++ b/node_modules/@strapi/plugin-upload/admin/src/components/AssetCard/ImageAssetCard.js | ||
@@ -10,7 +10,10 @@ import { AssetCardBase } from './AssetCardBase'; | ||
export const ImageAssetCard = ({ height, width, thumbnail, size, alt, ...props }) => { | ||
// Prevents the browser from caching the URL for all sizes and allow react-query to make a smooth update | ||
// instead of a full refresh | ||
- const urlWithCacheBusting = appendSearchParamsToUrl({ url: thumbnail, params: { updatedAt: props.updatedAt } }); | ||
+ const urlWithCacheBusting = appendSearchParamsToUrl({ | ||
+ url: thumbnail.startsWith('/') ? location.origin + thumbnail : thumbnail, | ||
+ params: { updatedAt: props.updatedAt } | ||
+ }); | ||
|
||
return ( | ||
<AssetCardBase {...props} subtitle={height && width && ` - ${width}✕${height}`} variant="Image"> |
Oops, something went wrong.