Skip to content

Commit

Permalink
COMPASS-385 - Check data exists before modifying overlays for RTSS ta…
Browse files Browse the repository at this point in the history
…bles (#700)
  • Loading branch information
aherlihy authored and durran committed Dec 20, 2016
1 parent 138512f commit 08e274a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ const CurrentOpStore = Reflux.createStore({
}
this.overlayIndex = index;
this.inOverlay = true;
this.trigger(visErrors[this.overlayIndex], visOps[this.overlayIndex]);
const data = visOps.length === 0 ? [] : visOps[this.overlayIndex];
this.trigger(visErrors[this.overlayIndex], data);
},

mouseOut: function() {
this.inOverlay = false;
const startPause = Math.max(this.endPause - this.xLength, 0);
const visOps = this.allOps.slice(startPause, this.endPause);
const visErrors = this.errored.slice(startPause, this.endPause);
this.trigger(visErrors[this.overlayIndex], visOps[visOps.length - 1]);
const data = visOps.length === 0 ? [] : visOps[visOps.length - 1];
this.trigger(visErrors[this.overlayIndex], data);
},

currentOp: function() {
Expand Down
6 changes: 4 additions & 2 deletions src/internal-packages/server-stats/lib/store/top-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ const TopStore = Reflux.createStore({
}
this.overlayIndex = index;
this.inOverlay = true;
this.trigger(visErrors[this.overlayIndex], visOps[this.overlayIndex]);
const data = visOps.length === 0 ? [] : visOps[this.overlayIndex];
this.trigger(visErrors[this.overlayIndex], data);
},

mouseOut: function() {
this.inOverlay = false;
const startPause = Math.max(this.endPause - this.xLength, 0);
const visOps = this.allOps.slice(startPause, this.endPause);
const visErrors = this.errored.slice(startPause, this.endPause);
this.trigger(visErrors[this.overlayIndex], visOps[visOps.length - 1]);
const data = visOps.length === 0 ? [] : visOps[visOps.length - 1];
this.trigger(visErrors[this.overlayIndex], data);
},

// Calculate list as current hottest collection (like Cloud and system top)
Expand Down

0 comments on commit 08e274a

Please sign in to comment.