Skip to content

Commit cb7abf8

Browse files
committed
fix: ignore updates when the minimap is closed
Closes #81
1 parent 49fa632 commit cb7abf8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Minimap.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ Minimap.prototype._init = function() {
440440

441441
Minimap.prototype._debouncedUpdate = function() {
442442

443+
// ignore updates if closed
444+
if (!this.isOpen()) {
445+
return;
446+
}
447+
443448
const {
444449
debounceDelay = 100,
445450
debounceSkipDelay = 2000
@@ -466,6 +471,11 @@ Minimap.prototype._debouncedUpdate = function() {
466471

467472
Minimap.prototype._update = function() {
468473

474+
// ignore updates if closed
475+
if (!this.isOpen()) {
476+
return;
477+
}
478+
469479
// if update was forced, clear any timeouts
470480
if (this._updateTimeout) {
471481
clearTimeout(this._updateTimeout);

0 commit comments

Comments
 (0)