@veritree/ui 0.58.0 → 0.58.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/images.js +12 -6
package/package.json
CHANGED
package/src/utils/images.js
CHANGED
|
@@ -7,12 +7,18 @@ export const handleImageResizing = (url, width) => {
|
|
|
7
7
|
let cdn;
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
// new code
|
|
11
|
+
if( url === 'string' && url.includes('cloudfront.net/')) {
|
|
12
|
+
cdn = url;
|
|
13
|
+
} else {
|
|
14
|
+
// old code
|
|
15
|
+
if (typeof url === 'object') {
|
|
16
|
+
cdn = url.cdn_url;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof url === 'string') {
|
|
20
|
+
cdn = JSON.parse(url).cdn_url;
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
const base64String = cdn.split('net/');
|