mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Prettified Code!
This commit is contained in:
parent
f79cdf8f65
commit
8a48f1d04a
1 changed files with 41 additions and 38 deletions
|
@ -765,20 +765,15 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => {
|
|||
add_obj_to_database(obj);
|
||||
update_chat_obj_by_uuid(obj.uuid);
|
||||
|
||||
db
|
||||
.find({
|
||||
db.find({
|
||||
selector: {
|
||||
dxcallsign: obj.dxcallsign,
|
||||
},
|
||||
})
|
||||
.then(function (result) {
|
||||
}).then(function (result) {
|
||||
// handle result
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//handle ping
|
||||
} else if (item.ping == "received") {
|
||||
obj.timestamp = parseInt(item.timestamp);
|
||||
|
@ -1414,7 +1409,10 @@ update_chat = function (obj) {
|
|||
console.log("element already exists......");
|
||||
console.log(obj);
|
||||
|
||||
if (!obj.status == "broadcast_transmit" || !obj.status == "broadcast_received") {
|
||||
if (
|
||||
!obj.status == "broadcast_transmit" ||
|
||||
!obj.status == "broadcast_received"
|
||||
) {
|
||||
document.getElementById("msg-" + obj._id + "-status").innerHTML =
|
||||
get_icon_for_state(obj.status);
|
||||
|
||||
|
@ -1447,7 +1445,10 @@ update_chat = function (obj) {
|
|||
document.getElementById(
|
||||
"msg-" + obj._id + "-progress-information"
|
||||
).innerHTML = "TRANSMITTED - " + obj.bytesperminute + " Bpm";
|
||||
} else if (!obj.status == "broadcast_transmit" || !obj.status == "broadcast_received") {
|
||||
} else if (
|
||||
!obj.status == "broadcast_transmit" ||
|
||||
!obj.status == "broadcast_received"
|
||||
) {
|
||||
document
|
||||
.getElementById("msg-" + obj._id + "-progress")
|
||||
.classList.add("progress-bar-striped");
|
||||
|
@ -1755,15 +1756,17 @@ add_obj_to_database = function (obj) {
|
|||
.catch(function (err) {
|
||||
console.log("already exists");
|
||||
console.log(err);
|
||||
console.log(obj)
|
||||
console.log(obj);
|
||||
db.upsert(obj.uuid, function (doc) {
|
||||
doc = obj
|
||||
doc = obj;
|
||||
return doc;
|
||||
}).then(function (response) {
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log("upsert");
|
||||
console.log(response);
|
||||
}).catch(function (err) {;
|
||||
console.log(err)
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -2067,7 +2070,7 @@ async function updateAllChat(clear) {
|
|||
],
|
||||
})
|
||||
.then(async function (result) {
|
||||
console.log(result)
|
||||
console.log(result);
|
||||
// handle result async
|
||||
//document.getElementById("blurOverlay").classList.add("bg-primary");
|
||||
console.log(result);
|
||||
|
|
Loading…
Reference in a new issue