Skip to content

Commit daaf07b

Browse files
fix: fallback image in feedzy block
1 parent 2804edc commit daaf07b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

js/FeedzyBlock/Editor.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,22 @@ class Editor extends Component {
311311

312312
getImageURL(item, background) {
313313
let url;
314-
if (item.thumbnail && this.props.attributes.thumb === 'auto') {
315-
url = item.thumbnail;
314+
window.console.log(this.props.attributes);
315+
window.console.log(item);
316+
if (
317+
item.thumbnail &&
318+
this.props.attributes.thumb === 'auto' &&
319+
item.thumbnail !== item.default_img
320+
) {
321+
url = item.thumbnail.replace(/http:/g, 'https:');
316322
} else if (this.props.attributes.default) {
317323
url = this.props.attributes.default.url;
324+
} else if (item.default_img) {
325+
url = item.default_img;
318326
} else {
319327
url = window.feedzyjs.imagepath + 'feedzy.svg';
320328
}
321329

322-
url = url.replace(/http:/g, 'https:');
323-
324330
if (background) {
325331
url = 'url("' + url + '")';
326332
}

0 commit comments

Comments
 (0)