Skip to content

Commit c3e323a

Browse files
Darshan-upadhyay1110quikee
authored andcommitted
Fix: Avoid redundant getpresentationinfo call when startPresentation parameter is used
- Added a `_startingPresentation` flag to track the state of the presentation startup. - Modified the `onUpdateParts` method to prevent redundant `getpresentationinfo` calls during initialization. - Updated the presentation start logic to set the flag when the presentation begins, ensuring the request is sent only once. Signed-off-by: Darshan-upadhyay1110 <[email protected]> Change-Id: Ib1edc8b57a3ec879db93cffbd649b5b96d0004f4
1 parent 74e46a9 commit c3e323a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

browser/src/slideshow/SlideShowPresenter.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class SlideShowPresenter {
129129
private _cypressSVGPresentationTest: boolean = false;
130130
private _onKeyDownHandler: (e: KeyboardEvent) => void;
131131
private _onImpressModeChanged: any = null;
132+
private _startingPresentation: boolean = false;
132133

133134
constructor(map: any) {
134135
this._cypressSVGPresentationTest =
@@ -172,7 +173,8 @@ class SlideShowPresenter {
172173
}
173174

174175
private onUpdateParts() {
175-
if (this._checkAlreadyPresenting()) this.onSlideShowInfoChanged();
176+
if (this._checkAlreadyPresenting() && !this._startingPresentation)
177+
this.onSlideShowInfoChanged();
176178
}
177179

178180
public getNavigator() {
@@ -407,6 +409,7 @@ class SlideShowPresenter {
407409
}
408410

409411
this._canvasLoader.startLoader();
412+
this._startingPresentation = false;
410413
}
411414

412415
public stopLoader(): void {
@@ -705,7 +708,7 @@ class SlideShowPresenter {
705708
return;
706709
// disable slide sorter or it will receive key events
707710
this._map._docLayer._preview.partsFocused = false;
708-
711+
this._startingPresentation = true;
709712
app.socket.sendMessage('getpresentationinfo');
710713
}
711714

@@ -717,6 +720,7 @@ class SlideShowPresenter {
717720
return;
718721
// disable present in console onStartInWindow
719722
this._enablePresenterConsole(true);
723+
this._startingPresentation = true;
720724
app.socket.sendMessage('getpresentationinfo');
721725
}
722726

0 commit comments

Comments
 (0)