aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-10 15:02:41 -0500
committerbobzel <zzzman@gmail.com>2022-11-10 15:02:41 -0500
commite4bd0a61a3c21179bd84d7f42b60b12a94886385 (patch)
tree334d99b3b92008a1931175083e304e44f5cc20ab /src
parentfe2ee94451bfef6942ad8538f6766848ff433a3c (diff)
fixed restarting presentation by hitting play at end of presentation
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index ccf19efc9..88cb3ce1d 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -634,19 +634,21 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
//The function that starts or resets presentaton functionally, depending on presStatus of the layoutDoc
@action
- startAutoPres = (startSlide: number) => {
+ startAutoPres = async (startSlide: number) => {
this.layoutDoc.presStatus = PresStatus.Autoplay;
- this.startPresentation(startSlide);
+ 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) => {
if (itemIndex === this.next()) this.layoutDoc.presStatus = PresStatus.Manual;
- else
- this._presTimer = setTimeout(
- () => this.layoutDoc.presStatus !== PresStatus.Manual && func(this.itemIndex),
- NumCast(this.activeItem.presDuration, this.activeItem.type === DocumentType.SCRIPTING ? 0 : 2500) + NumCast(this.activeItem.presTransition)
- );
+ this._presTimer = setTimeout(
+ () => this.layoutDoc.presStatus !== PresStatus.Manual && func(this.itemIndex),
+ NumCast(this.activeItem.presDuration, this.activeItem.type === DocumentType.SCRIPTING ? 0 : 2500) + NumCast(this.activeItem.presTransition)
+ );
};
-
func(this.itemIndex);
};