diff options
-rw-r--r-- | src/client/views/nodes/trails/PresBox.tsx | 14 |
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 |