Skip to content

Commit 592504a

Browse files
authored
Merge pull request #71 from wavelog/fix_timeout
Refresh WL at least every 30mins (if you stay on a frequency)
2 parents d9964b2 + ed24e49 commit 592504a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

renderer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const input_key=select("#wavelog_key");
2222
const input_url=select("#wavelog_url");
2323

2424
var oldCat={ vfo: 0, mode: "SSB" };
25+
var lastCat=0;
2526

2627
$(document).ready(function() {
2728

@@ -179,7 +180,7 @@ async function get_trx() {
179180
currentCat.modeB=await getInfo('rig.get_modeB');
180181

181182
$("#current_trx").html((currentCat.vfo/(1000*1000))+" MHz / "+currentCat.mode);
182-
if (!(isDeepEqual(oldCat,currentCat))) {
183+
if (((Date.now()-lastCat) > (30*60*1000)) || (!(isDeepEqual(oldCat,currentCat)))) {
183184
console.log(await informWavelog(currentCat));
184185
}
185186
oldCat=currentCat;
@@ -286,6 +287,7 @@ const isObject = (object) => {
286287
};
287288

288289
async function informWavelog(CAT) {
290+
lastCat=Date.now();
289291
let data = {
290292
radio: "WLGate",
291293
key: cfg.profiles[active_cfg].wavelog_key,

0 commit comments

Comments
 (0)