Skip to content

Commit

Permalink
Merge pull request #6 from boom/patch/fix-polling-timing
Browse files Browse the repository at this point in the history
Patch/fix polling timing
  • Loading branch information
Anthony Barone authored Oct 25, 2016
2 parents d26bdaf + d758dec commit 33304f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flourish.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function runFlourish(evt) {
var $;
var pollStagesInterval;
var sessionToken;
var boardId;

function isJQueryReady() {
if (typeof window.jQuery !== "undefined") {
Expand All @@ -20,7 +21,7 @@ function runFlourish(evt) {

improveCollaborationBox();
listenForCardClicks();
pollStagesInterval = setInterval(pollStages, 5 * 1000); // 1 minute
pollStagesInterval = setInterval(pollStages, 60 * 1000); // 1 minute
}
}

Expand Down Expand Up @@ -134,7 +135,12 @@ function runFlourish(evt) {
return;
}

var boardId = urlParts[urlParts.length - 2];
// We've changed boards since last call so stages and cards
// will be different. Don't trigger a reload
if (boardId && boardId !== urlParts[urlParts.length - 2]) {
resetStagesOnNextCall = true;
}
boardId = urlParts[urlParts.length - 2];
activelyPollingStages = true;

$.ajax({
Expand Down

0 comments on commit 33304f7

Please sign in to comment.