mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
[CodeFactor] Apply fixes
This commit is contained in:
parent
a2c53b5496
commit
05e44d7983
|
@ -18,7 +18,12 @@ import { settingsStore as settings } from "../store/settingsStore.js";
|
|||
import { displayToast } from "./popupHandler.js";
|
||||
|
||||
//const FD = require("./src/js/freedata.js");
|
||||
import { atob_FD, btoa_FD, sortByProperty, sortByPropertyDesc } from "./freedata.js";
|
||||
import {
|
||||
atob_FD,
|
||||
btoa_FD,
|
||||
sortByProperty,
|
||||
sortByPropertyDesc,
|
||||
} from "./freedata.js";
|
||||
|
||||
import { sendModemARQRaw } from "../js/api.js";
|
||||
|
||||
|
@ -860,20 +865,18 @@ export function newMessageReceived(message, protocol) {
|
|||
|
||||
*/
|
||||
|
||||
|
||||
console.log(protocol);
|
||||
|
||||
var encoded_data = atob_FD(message);
|
||||
var splitted_data = encoded_data.split(split_char);
|
||||
|
||||
// new message received
|
||||
if (splitted_data[0] == "m") {
|
||||
// new message received
|
||||
if (splitted_data[0] == "m") {
|
||||
console.log(splitted_data);
|
||||
message = splitted_data;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
let newChatObj: messageDefaultObject = {
|
||||
command: "msg",
|
||||
|
@ -884,11 +887,11 @@ export function newMessageReceived(message, protocol) {
|
|||
_id: message[3],
|
||||
timestamp: message[4],
|
||||
dxcallsign: protocol["dxcall"],
|
||||
dxgrid: '',
|
||||
dxgrid: "",
|
||||
msg: message[5],
|
||||
checksum: message[2],
|
||||
type: 'received',
|
||||
status: 'received',
|
||||
type: "received",
|
||||
status: "received",
|
||||
attempt: 1,
|
||||
uuid: message[3],
|
||||
duration: 0,
|
||||
|
|
|
@ -171,7 +171,10 @@ export function eventDispatcher(data) {
|
|||
message = `Type: ${data.type}, Session ID: ${data["arq-transfer-inbound"].session_id}, DXCall: ${data["arq-transfer-inbound"].dxcall}, Received Bytes: ${data["arq-transfer-inbound"].received_bytes}/${data["arq-transfer-inbound"].total_bytes}, State: ${data["arq-transfer-inbound"].state}`;
|
||||
displayToast("info", "bi-info-circle", message, 5000);
|
||||
// Forward data to chat module
|
||||
newMessageReceived(data["arq-transfer-inbound"].data, data["arq-transfer-inbound"]);
|
||||
newMessageReceived(
|
||||
data["arq-transfer-inbound"].data,
|
||||
data["arq-transfer-inbound"],
|
||||
);
|
||||
return;
|
||||
|
||||
case "ABORTED":
|
||||
|
|
Loading…
Reference in a new issue