From bf661694e40c16deaa633ae9e87d5b82cdfcfa71 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Mon, 18 Jul 2022 19:51:43 -0400 Subject: [PATCH] Update overview.php --- scripts/overview.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/overview.php b/scripts/overview.php index bf7df3f..3d9c352 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -289,7 +289,7 @@ function loadDetectionIfNewExists(previous_detection_identifier=undefined) { const xhttp = new XMLHttpRequest(); xhttp.onload = function() { // if there's a new detection that needs to be updated to the page - if(this.responseText.length > 0 && !this.responseText.includes("Database is busy")) { + if(this.responseText.length > 0 && !this.responseText.includes("Database is busy") && !this.responseText.includes("No Detections") || previous_detection_identifier == undefined) { document.getElementById("most_recent_detection").innerHTML = this.responseText; // only going to load left chart & 5 most recents if there's a new detection @@ -314,7 +314,7 @@ function loadLeftChart() { function refreshTopTen() { const xhttp = new XMLHttpRequest(); xhttp.onload = function() { - if(this.responseText.length > 0 && !this.responseText.includes("Database is busy")) { + if(this.responseText.length > 0 && !this.responseText.includes("Database is busy") && !this.responseText.includes("No Detections") || previous_detection_identifier == undefined) { document.getElementById("chart").src = "/Charts/"+this.responseText+"?nocache="+Date.now(); } }