Skip to content

Commit

Permalink
browser: slideshow: fix interval timer
Browse files Browse the repository at this point in the history
Also it is the interval timer of the proxy window

Change-Id: I21664bba0d5c66cc0c27d82283477c5bbbd2c0b6
Signed-off-by: Henry Castro <[email protected]>
  • Loading branch information
hcvcastro committed Nov 18, 2024
1 parent e0dd9f4 commit 9b9ae16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions browser/src/slideshow/PresenterConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ class PresenterConsole {
this._proxyPresenter.document.querySelector('#current-presentation'),
);

this._timer = setInterval(L.bind(this._onTimer, this), 1000);
this._timer = this._proxyPresenter.setInterval(
L.bind(this._onTimer, this),
1000,
);
this._ticks = 0;
this._pause = false;

Expand Down Expand Up @@ -768,11 +771,13 @@ class PresenterConsole {
'keydown',
L.bind(this._onKeyDown, this),
);
this._proxyPresenter.clearInterval(this._timer);

delete this._proxyPresenter;
delete this._currentIndex;
delete this._lastIndex;
delete this._previews;
clearInterval(this._timer);

this._map.off('newslideshowframe', this._onNextFrame, this);
this._map.off('transitionstart', this._onTransitionStart, this);
this._map.off('transitionend', this._onTransitionEnd, this);
Expand Down

0 comments on commit 9b9ae16

Please sign in to comment.