Skip to content

Commit

Permalink
Prettified Code!
Browse files Browse the repository at this point in the history
  • Loading branch information
DJ2LS authored and actions-user committed Aug 7, 2024
1 parent a7a26bc commit 2ae4e02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
5 changes: 2 additions & 3 deletions freedata_gui/src/js/eventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ export function eventDispatcher(data) {
stateStore.arq_transmission_percent = Math.round(
(data["arq-transfer-outbound"].received_bytes /
data["arq-transfer-outbound"].total_bytes) *
100);
100,
);
stateStore.arq_total_bytes =
data["arq-transfer-outbound"].received_bytes;


// Reset progressbar values after a delay
setTimeout(() => {
stateStore.arq_transmission_percent = 0;
Expand Down Expand Up @@ -301,7 +301,6 @@ export function eventDispatcher(data) {
stateStore.arq_total_bytes =
data["arq-transfer-inbound"].received_bytes;


// Reset progressbar values after a delay
setTimeout(() => {
stateStore.arq_transmission_percent = 0;
Expand Down
19 changes: 9 additions & 10 deletions freedata_gui/src/js/messagesHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
deleteFreedataMessage,
retransmitFreedataMessage,
getFreedataAttachmentBySha512,
getFreedataMessageById
getFreedataMessageById,
} from "./api";

/**
Expand Down Expand Up @@ -135,20 +135,19 @@ export function deleteMessageFromDB(id) {
*/
export function requestMessageInfo(id) {
return getFreedataMessageById(id)
.then(result => {
.then((result) => {
console.log(result);

try {
chatStore.messageInfoById = JSON.parse(result);

} catch (error) {
console.error('Error parsing JSON:', error);
chatStore.messageInfoById = null
}
try {
chatStore.messageInfoById = JSON.parse(result);
} catch (error) {
console.error("Error parsing JSON:", error);
chatStore.messageInfoById = null;
}

return result;
})
.catch(error => {
.catch((error) => {
console.error("Error fetching message:", error);
});
}
Expand Down

0 comments on commit 2ae4e02

Please sign in to comment.