aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/ReplayMovements.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-02 09:26:37 -0400
committerbobzel <zzzman@gmail.com>2024-09-02 09:26:37 -0400
commitcda69e48361fce8d71a4dc66edd9dd976a27f52d (patch)
tree82b9a1a5967ae88a9534f89f7eaed3aeb289652f /src/client/util/ReplayMovements.ts
parentc01828308714874589d1f60c33ca59df4c656c0c (diff)
parenta958577d4c27b276aa37484e3f895e196138b17c (diff)
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/util/ReplayMovements.ts')
-rw-r--r--src/client/util/ReplayMovements.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/util/ReplayMovements.ts b/src/client/util/ReplayMovements.ts
index c5afe549c..62a09a8bc 100644
--- a/src/client/util/ReplayMovements.ts
+++ b/src/client/util/ReplayMovements.ts
@@ -7,11 +7,12 @@ import { SnappingManager } from './SnappingManager';
import { Movement, Presentation } from './TrackMovements';
import { ViewBoxInterface } from '../views/ViewBoxInterface';
import { StrCast } from '../../fields/Types';
+import { FieldViewProps } from '../views/nodes/FieldView';
export class ReplayMovements {
private timers: NodeJS.Timeout[] | null;
private videoBoxDisposeFunc: IReactionDisposer | null;
- private videoBox: ViewBoxInterface<any> | null;
+ private videoBox: ViewBoxInterface<FieldViewProps> | null;
private isPlaying: boolean;
// create static instance and getter for global use
@@ -62,7 +63,7 @@ export class ReplayMovements {
this.timers?.map(timer => clearTimeout(timer));
};
- setVideoBox = async (videoBox: ViewBoxInterface<any>) => {
+ setVideoBox = async (videoBox: ViewBoxInterface<FieldViewProps>) => {
if (this.videoBox !== null) {
console.warn('setVideoBox on already videoBox');
}
@@ -147,7 +148,7 @@ export class ReplayMovements {
// generate a set of all unique docIds
const docIdtoFirstMove = new Map<Doc, Movement>();
movements.forEach(move => {
- if (!docIdtoFirstMove.has(move.doc)) docIdtoFirstMove.set(move.doc, move);
+ if (!docIdtoFirstMove.has(move.doc as Doc)) docIdtoFirstMove.set(move.doc as Doc, move);
});
return docIdtoFirstMove;
};
@@ -175,8 +176,8 @@ export class ReplayMovements {
const handleFirstMovements = () => {
// if the first movement is a closed tab, open it
const firstMovement = filteredMovements[0];
- const isClosed = this.getCollectionFFView(firstMovement.doc) === undefined;
- if (isClosed) this.openTab(firstMovement.doc);
+ const isClosed = this.getCollectionFFView(firstMovement.doc as Doc) === undefined;
+ if (isClosed) this.openTab(firstMovement.doc as Doc);
// for the open tabs, set it to the first move
const docIdtoFirstMove = this.getFirstMovements(filteredMovements);
@@ -192,12 +193,12 @@ export class ReplayMovements {
const timeDiff = movement.time - timeViewed * 1000;
return setTimeout(() => {
- const collectionFFView = this.getCollectionFFView(movement.doc);
+ const collectionFFView = this.getCollectionFFView(movement.doc as Doc);
if (collectionFFView) {
this.zoomAndPan(movement, collectionFFView);
} else {
// tab wasn't open - open it and play the movement
- const openedColFFView = this.openTab(movement.doc);
+ const openedColFFView = this.openTab(movement.doc as Doc);
openedColFFView && this.zoomAndPan(movement, openedColFFView);
}