[CodeFactor] Apply fixes to commit 8d62550

This commit is contained in:
codefactor-io 2024-02-06 19:09:39 +00:00
parent 8d62550775
commit 1f38267626
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
3 changed files with 40 additions and 21 deletions

View file

@ -2,13 +2,25 @@
<div class="row justify-content-start mb-2">
<div :class="messageWidthClass">
<div class="card bg-light border-0 text-dark">
<div v-for="attachment in message.attachments" :key="attachment.id" class="card-header">
<div class="btn-group w-100" role="group">
<button class="btn btn-light text-truncate" disabled>{{ attachment.name }}</button>
<button @click="downloadAttachment(attachment.hash_sha512, attachment.name)" class="btn btn-light w-25"><i class="bi bi-download strong"></i></button>
<div
v-for="attachment in message.attachments"
:key="attachment.id"
class="card-header"
>
<div class="btn-group w-100" role="group">
<button class="btn btn-light text-truncate" disabled>
{{ attachment.name }}
</button>
<button
@click="
downloadAttachment(attachment.hash_sha512, attachment.name)
"
class="btn btn-light w-25"
>
<i class="bi bi-download strong"></i>
</button>
</div>
</div>
</div>
<div class="card-body">
<p class="card-text">{{ message.body }}</p>
@ -33,8 +45,6 @@
<i class="bi bi-info-circle"></i>
</button>
<button class="btn btn-outline-secondary border-0" @click="deleteMessage">
<i class="bi bi-trash"></i>
</button>
@ -92,7 +102,7 @@ export default {
const url = URL.createObjectURL(blob);
// Creating a temporary anchor element to download the file
const anchor = document.createElement('a');
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = fileName;
document.body.appendChild(anchor);
@ -107,7 +117,6 @@ export default {
},
},
computed: {
messageWidthClass() {
// Calculate a Bootstrap grid class based on message length
// Adjust the logic as needed to fit your requirements

View file

@ -2,7 +2,6 @@
<div class="row justify-content-end mb-2">
<!-- control area -->
<div class="col-auto p-0 m-0">
<button
class="btn btn-outline-secondary border-0 me-1"
@click="repeatMessage"
@ -27,14 +26,25 @@
<!-- message area -->
<div :class="messageWidthClass">
<div class="card bg-secondary text-white">
<div v-for="attachment in message.attachments" :key="attachment.id" class="card-header">
<div class="btn-group w-100" role="group">
<button class="btn btn-light text-truncate" disabled>{{ attachment.name }}</button>
<button @click="downloadAttachment(attachment.hash_sha512, attachment.name)" class="btn btn-light w-25"><i class="bi bi-download strong"></i></button>
<div
v-for="attachment in message.attachments"
:key="attachment.id"
class="card-header"
>
<div class="btn-group w-100" role="group">
<button class="btn btn-light text-truncate" disabled>
{{ attachment.name }}
</button>
<button
@click="
downloadAttachment(attachment.hash_sha512, attachment.name)
"
class="btn btn-light w-25"
>
<i class="bi bi-download strong"></i>
</button>
</div>
</div>
</div>
<div class="card-body">
<p class="card-text">{{ message.body }}</p>
@ -137,7 +147,7 @@ export default {
const url = URL.createObjectURL(blob);
// Creating a temporary anchor element to download the file
const anchor = document.createElement('a');
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = fileName;
document.body.appendChild(anchor);

View file

@ -78,7 +78,7 @@ function createSortedMessagesList(data: {
}
export function newMessage(dxcall, body, attachments) {
console.log(attachments)
console.log(attachments);
sendFreedataMessage(dxcall, body, attachments);
}
@ -102,5 +102,5 @@ export function requestMessageInfo(id) {
}
export async function getMessageAttachment(data_sha512) {
return await getFreedataAttachmentBySha512(data_sha512)
return await getFreedataAttachmentBySha512(data_sha512);
}