From ace19e1d0fbf74bec64127a86025be62e4cb52e4 Mon Sep 17 00:00:00 2001 From: Jeremy Cunningham Date: Thu, 10 Sep 2020 13:58:15 -0500 Subject: [PATCH] fix brushing recursion --- lib/client/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/client/index.js b/lib/client/index.js index ce8efa92f38..c329c5cec0b 100644 --- a/lib/client/index.js +++ b/lib/client/index.js @@ -15,6 +15,8 @@ var levels = require('../levels'); var times = require('../times'); var receiveDData = require('./receiveddata'); +var brushing = false; + var client = {}; $('#loadingMessageText').html('Connecting to server'); @@ -421,6 +423,12 @@ client.load = function load (serverSettings, callback) { return; } + if (brushing) { + return; + } + + brushing = true; + // default to most recent focus period var brushExtent = client.dataExtent(); brushExtent[0] = new Date(brushExtent[1].getTime() - client.focusRangeMS); @@ -605,6 +613,8 @@ client.load = function load (serverSettings, callback) { var top = (client.bottomOfPills() + 5); $('#chartContainer').css({ top: top + 'px', height: $(window).height() - top - 10 }); container.removeClass('loading'); + + brushing = false; } function sgvToColor (sgv) {