Skip to content

Commit f0fc3ac

Browse files
On presenter console window reload close the slideshow
- Slide show should be closed on window reload - otherwise it opens up the edit window which is already there in main window Signed-off-by: Darshan-upadhyay1110 <[email protected]> Change-Id: I65bbdb19ecb9c41c0b80fcc488bc6e50acdea8f5
1 parent a4d480a commit f0fc3ac

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

browser/src/slideshow/PresenterConsole.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ class PresenterConsole {
123123
this._map.on('transitionend', this._onTransitionEnd, this);
124124
this._map.on('tilepreview', this._onTilePreview, this);
125125

126-
this._computeCanvas(
127-
this._proxyPresenter.document.querySelector('#current-presentation'),
128-
);
126+
// safe check for current-presentation element
127+
const currentPresentationCanvas =
128+
this._proxyPresenter.document.querySelector('#current-presentation');
129+
if (!currentPresentationCanvas) return;
130+
this._computeCanvas(currentPresentationCanvas);
129131

130132
this._timer = this._proxyPresenter.setInterval(
131133
L.bind(this._onTimer, this),
@@ -1056,7 +1058,6 @@ class PresenterConsole {
10561058
);
10571059
this._proxyPresenter.clearInterval(this._timer);
10581060

1059-
delete this._proxyPresenter;
10601061
delete this._currentIndex;
10611062
delete this._lastIndex;
10621063
delete this._previews;

browser/src/slideshow/SlideShowPresenter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,10 @@ class SlideShowPresenter {
557557
'keydown',
558558
this._onKeyDownHandler,
559559
);
560-
560+
this._slideShowWindowProxy.addEventListener(
561+
'unload',
562+
L.bind(this._closeSlideShowWindow, this),
563+
);
561564
const slideShowWindow = this._slideShowWindowProxy;
562565
this._map.uiManager.showSnackbar(
563566
_('Presenting in window'),
@@ -677,6 +680,7 @@ class SlideShowPresenter {
677680
}
678681

679682
_notifyBlockedPresenting() {
683+
this._enablePresenterConsole(false);
680684
this._map.uiManager.showInfoModal(
681685
'popup-blocked-modal',
682686
_('Windowed Presentation Blocked'),

0 commit comments

Comments
 (0)