diff --git a/src/modules/contacts/modules/timeline/modules/chats/components/point-row/chat-point-timeline-row-file.vue b/src/modules/contacts/modules/timeline/modules/chats/components/point-row/chat-point-timeline-row-file.vue index 15cd5d47..79b219a8 100644 --- a/src/modules/contacts/modules/timeline/modules/chats/components/point-row/chat-point-timeline-row-file.vue +++ b/src/modules/contacts/modules/timeline/modules/chats/components/point-row/chat-point-timeline-row-file.vue @@ -5,7 +5,7 @@ /> {{ props.file.name }} diff --git a/src/modules/contacts/modules/timeline/utils/downloadFile.js b/src/modules/contacts/modules/timeline/utils/downloadFile.js index 8023f46b..cd9919a1 100644 --- a/src/modules/contacts/modules/timeline/utils/downloadFile.js +++ b/src/modules/contacts/modules/timeline/utils/downloadFile.js @@ -1,14 +1,21 @@ -const downloadFile = ({ id, name, type }) => { +const downloadFile = ({ id, name, type, url }) => { + const a = document.createElement('a'); const token = localStorage.getItem('access-token'); - let link = `${import.meta.env.VITE_API_URL}/storage/file/${id}/download?access_token=${token}`; - if (type.includes('source')) { - const source = type.match(/source=[^;]+/)[0]; - link = `${link}&${source}`; + if(url) { + a.href = url; + + } else { + let link = `${import.meta.env.VITE_API_URL}/storage/file/${id}/download?access_token=${token}`; + + if (type.includes('source')) { + const source = type.match(/source=[^;]+/)[0]; + link = `${link}&${source}`; + } + a.href = link; } - a.href = link; a.target = '_blank'; a.download = name; a.click();