From 46172e0424556d18636764a9eb2178e8a0a4e1f5 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 22 Jan 2021 19:44:11 +0100 Subject: [PATCH] eliminate unnecessary fetches for /?feed stuff --- html/early.js | 7 ++++--- html/script.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/html/early.js b/html/early.js index f0b8309..78639cd 100644 --- a/html/early.js +++ b/html/early.js @@ -178,8 +178,9 @@ function lDateString(date) { let get_receiver_defer; let test_chunk_defer; - -if (!window.location.href.match(/globe.*adsbexchange.com/)) { +if (uuid) { + // don't need receiver / chunks json +} else if (!window.location.href.match(/globe.*adsbexchange.com/)) { // get configuration json files, will be used in initialize function get_receiver_defer = $.ajax({ url: 'data/receiver.json', cache: false, @@ -250,7 +251,6 @@ if (!heatmap) { } if (uuid != null) { - get_receiver_defer = null; receiverJson = null; Dump1090Version = 'unknown'; RefreshInterval = 5000; @@ -486,6 +486,7 @@ function handleVisibilityChange() { // tab is no longer hidden if (!tabHidden) { + active(); fetchData(); if (showTrace) return; diff --git a/html/script.js b/html/script.js index 7df237c..34e1b14 100644 --- a/html/script.js +++ b/html/script.js @@ -645,7 +645,7 @@ function initPage() { }, 30000); } - if (adsbexchange) { + if (adsbexchange && !uuid) { setInterval(globeRateUpdate(), 300000); } @@ -4837,7 +4837,7 @@ function drawUpintheair() { // NB: altitudes are in _meters_, you can specify a list of altitudes // kick off an ajax request that will add the rings when it's done - if (!globeIndex) { + if (!globeIndex && !uuid) { let request = $.ajax({ url: 'upintheair.json', cache: true, dataType: 'json' });