Skip to content

Commit

Permalink
Merge branch 'fix/media-show-placeholder-when-using-data-url-PRDGM-37…
Browse files Browse the repository at this point in the history
…7' into edge
  • Loading branch information
ingmar-stipriaan committed Nov 23, 2023
2 parents a2500fe + 7540e71 commit 95f27db
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
const { url: videoSource = '#', name: videoName = 'video' } =
usePublicFile(videoFileSource) || {};

const isUrlImg = type === 'url' && urlSourceType === 'image';
const isURLVideo = type === 'url' && urlSourceType === 'video';
const isImgUrl = type === 'url' && urlSourceType === 'image';
const isVideoUrl = type === 'url' && urlSourceType === 'video';
const isDataUrl = type === 'data' && propertyFileSource && propValue;
const isImage = type === 'img' || isUrlImg || isDataUrl;
const isVideo = type === 'video' || isURLVideo;
const isImage = type === 'img' || isImgUrl || isDataUrl;
const isVideo = type === 'video' || isVideoUrl;
const isData = type === 'data' || isDataUrl;
const isIframe = type === 'iframe' && iframeUrl;
const urlFileSourceText = useText(urlFileSource);
const videoUrl = isURLVideo ? urlFileSourceText : videoSource;
const videoUrl = isVideoUrl ? urlFileSourceText : videoSource;

function getImgUrl() {
switch (true) {
case isDataUrl && propValue !== {}:
return propValue[propertyFileSource.useKey];
case isUrlImg:
case isImgUrl:
return urlFileSourceText;
case type === 'img':
return imgSource;
Expand Down Expand Up @@ -74,10 +74,10 @@
const isEmpty = !isImage && !isVideo && !isData && !isIframe;

const isVariable =
(isUrlImg || isURLVideo) &&
(isImgUrl || isVideoUrl) &&
urlFileSource &&
urlFileSource.findIndex((v) => v.name) !== -1;
const isVariableDev = (isDev && isUrlImg) || !imgSource;
const isVariableDev = isDev && (isImgUrl || !imgSource);

const hasInteralLink =
linkType === 'internal' && linkTo && linkTo.id !== '';
Expand Down

0 comments on commit 95f27db

Please sign in to comment.