aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-10 21:06:39 -0500
committerbobzel <zzzman@gmail.com>2022-11-10 21:06:39 -0500
commit778b251de77078ecb6d3570641b4472d842a1f77 (patch)
treeda65f7e52e1ddec96125b167caf2ca585d0c8595
parent65d3c9d2558dd9bee685bb97a4aec907d40d65b5 (diff)
playing a presentation that's at its end, resets it to slide 0.
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index c1973c4b4..5e9301e6a 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -646,10 +646,6 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
@action
startAutoPres = async (startSlide: number) => {
this.layoutDoc.presStatus = PresStatus.Autoplay;
- if (startSlide + 1 === this.childDocs.length) {
- this.gotoDocument(0);
- await new Promise<void>(res => setTimeout(() => res(), NumCast(this.activeItem.presDuration, this.activeItem.type === DocumentType.SCRIPTING ? 0 : 2500) + NumCast(this.activeItem.presTransition)));
- }
this.startPresentation(startSlide + 1 === this.childDocs.length ? 0 : startSlide);
clearTimeout(this._presTimer);
const func = (itemIndex: number) => {
@@ -2539,9 +2535,13 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
@action
startOrPause = (makeActive = true) => {
- makeActive && this.updateCurrentPresentation();
- if (this.layoutDoc.presStatus === PresStatus.Manual || this.layoutDoc.presStatus === PresStatus.Edit) this.startAutoPres(this.itemIndex);
- else this.pauseAutoPres();
+ if (this.itemIndex + 1 === this.childDocs.length) {
+ this.gotoDocument(0);
+ } else {
+ makeActive && this.updateCurrentPresentation();
+ if (this.layoutDoc.presStatus === PresStatus.Manual || this.layoutDoc.presStatus === PresStatus.Edit) this.startAutoPres(this.itemIndex);
+ else this.pauseAutoPres();
+ }
};
@action