Skip to content

Commit 5921e08

Browse files
committed
CBDEBUGGER-17
more fixes on monitor
1 parent 7a92edc commit 5921e08

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

resources/assets/js/components/RequestTrackerPanel.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,22 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
6767
} );
6868
},
6969
stopDebuggerMonitor(){
70+
// stop only if loaded
7071
if ( this.refreshMonitor != null ){
7172
clearInterval( this.refreshMonitor );
7273
this.refreshFrequency = 0;
7374
console.info( "Stopped ColdBox Debugger Profiler Refresh" );
7475
}
7576
},
7677
startDebuggerMonitor( frequency ){
77-
if ( frequency == 0 ){
78-
return this.stopDebuggerMonitor();
78+
// Ensure monitor is stopped just in case we are switching frequencies
79+
this.stopDebuggerMonitor();
80+
this.refreshFrequency = frequency;
81+
if ( this.refreshFrequency == 0 ){
82+
return;
7983
}
80-
this.refreshMonitor = setInterval( () => this.refreshProfilers(), frequency * 1000 );
81-
console.info( "Started ColdBox Debugger Profiler Refresh using " + frequency + " seconds" );
84+
this.refreshMonitor = setInterval( () => this.refreshProfilers(), this.refreshFrequency * 1000 );
85+
console.info( "Started ColdBox Debugger Profiler Refresh using " + this.refreshFrequency + " seconds" );
8286
},
8387
init(){
8488
window.addEventListener( "popstate", e => {

0 commit comments

Comments
 (0)