From 33c9b32d82b125e9c5925b10e5ccdbd49260193f Mon Sep 17 00:00:00 2001 From: cauefcr Date: Thu, 8 Sep 2022 16:15:33 -0300 Subject: [PATCH] [IMPROVE] Allow external attachments to be resolved --- packages/livechat/src/components/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livechat/src/components/helpers.js b/packages/livechat/src/components/helpers.js index 075a3a17f1a0..d81432e38f51 100644 --- a/packages/livechat/src/components/helpers.js +++ b/packages/livechat/src/components/helpers.js @@ -126,7 +126,7 @@ export const msgTypesNotRendered = ['livechat_video_call', 'livechat_navigation_ export const canRenderMessage = ({ t }) => !msgTypesNotRendered.includes(t); -export const getAttachmentUrl = (url) => `${ Livechat.client.host }${ url }`; +export const getAttachmentUrl = (url) => new URL(url, Livechat.client.host).toString(); export const sortArrayByColumn = (array, column, inverted) => array.sort((a, b) => { if (a[column] < b[column] && !inverted) {