Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Brushing Recursion Error #5987

Merged
merged 2 commits into from
Sep 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down