Sfoglia il codice sorgente

Bugfix. URL is passed in, not object

JC Brand 3 anni fa
parent
commit
1104b28758
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/shared/chat/templates/unfurl.js

+ 2 - 2
src/shared/chat/templates/unfurl.js

@@ -12,8 +12,8 @@ function isValidImage (image) {
     return image && isDomainAllowed(image, 'allowed_image_domains') && isValidURL(image);
 }
 
-function shouldHideMediaURL (o) {
-    return isGIFURL(o.url) || isVideoURL(o.url) || isAudioURL(o.url);
+function shouldHideMediaURL (url) {
+    return url && (isGIFURL(url) || isVideoURL(url) || isAudioURL(url));
 }
 
 const tpl_url_wrapper = (o, wrapped_template) =>