Prettified Code!

This commit is contained in:
DJ2LS 2023-05-14 17:45:07 +00:00 committed by GitHub Action
parent c7a9a6c1f1
commit 66ab3f4e21
3 changed files with 45 additions and 58 deletions

View file

@ -460,23 +460,19 @@ window.addEventListener("DOMContentLoaded", () => {
}
var timestamp = Math.floor(Date.now() / 1000);
// check if broadcast
dxcallsign.starts
if (dxcallsign.startsWith('BC-')) {
var tnc_command = "broadcast"
dxcallsign.starts;
if (dxcallsign.startsWith("BC-")) {
var tnc_command = "broadcast";
let Data = {
command: tnc_command,
broadcastChannel: dxcallsign,
data: chatmessage,
};
ipcRenderer.send("run-tnc-command", Data);
} else {
var file_checksum = crc32(file).toString(16).toUpperCase();
var tnc_command = "msg"
var tnc_command = "msg";
var file_checksum = crc32(file).toString(16).toUpperCase();
console.log(file_checksum);
var data_with_attachment =
@ -510,8 +506,6 @@ window.addEventListener("DOMContentLoaded", () => {
ipcRenderer.send("run-tnc-command", Data);
}
db.post({
_id: uuid,
timestamp: timestamp,

View file

@ -2787,10 +2787,7 @@ ipcRenderer.on("run-tnc-command", (event, arg) => {
);
}
if (arg.command == "broadcast") {
sock.sendBroadcastChannel(
arg.broadcastChannel,
arg.data
);
sock.sendBroadcastChannel(arg.broadcastChannel, arg.data);
}
if (arg.command == "stop_transmission") {
sock.stopTransmission();

View file

@ -837,10 +837,9 @@ exports.sendFecIsWriting = function (mycallsign) {
// SEND FEC TO BROADCASTCHANNEL
exports.sendBroadcastChannel = function (channel, data) {
let checksum = ''
let uuid = ''
let command = ''
let checksum = "";
let uuid = "";
let command = "";
data = FD.btoa_FD(
"m" +
split_char +
@ -853,8 +852,6 @@ exports.sendBroadcastChannel = function (channel, data) {
data
);
let payload = data;
command =
'{"type" : "fec", "command" : "transmit", "mode": "datac4", "wakeup": "True", "payload" : "' +
@ -863,7 +860,6 @@ exports.sendBroadcastChannel = function (channel, data) {
writeTncCommand(command);
};
// RECORD AUDIO
exports.record_audio = function () {
command = '{"type" : "set", "command" : "record_audio"}';