attempts for file attachments again

This commit is contained in:
Raven Scott 2024-06-09 06:13:58 -04:00
parent b07579cdc9
commit 0010feed24

4
app.js
View File

@ -352,13 +352,13 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar) {
if (fileType.startsWith('image/')) { if (fileType.startsWith('image/')) {
const $image = document.createElement('img'); const $image = document.createElement('img');
$image.src = fileUrl; $image.src = updatePortInUrl(fileUrl);
$image.alt = fileName; $image.alt = fileName;
$image.classList.add('attached-image'); $image.classList.add('attached-image');
$content.appendChild($image); $content.appendChild($image);
} else { } else {
const $fileLink = document.createElement('a'); const $fileLink = document.createElement('a');
$fileLink.href = fileUrl; $fileLink.href = updatePortInUrl(fileUrl);
$fileLink.textContent = `File: ${fileName}`; $fileLink.textContent = `File: ${fileName}`;
$fileLink.download = fileName; $fileLink.download = fileName;
$content.appendChild($fileLink); $content.appendChild($fileLink);