From 778b251de77078ecb6d3570641b4472d842a1f77 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 10 Nov 2022 21:06:39 -0500 Subject: playing a presentation that's at its end, resets it to slide 0. --- src/client/views/nodes/trails/PresBox.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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() { @action startAutoPres = async (startSlide: number) => { this.layoutDoc.presStatus = PresStatus.Autoplay; - if (startSlide + 1 === this.childDocs.length) { - this.gotoDocument(0); - await new Promise(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() { @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 -- cgit v1.2.3-70-g09d2