fix ui: prefetching sessions from widgets fix

This commit is contained in:
nick-delirium 2024-05-29 18:24:48 +02:00
parent 92a636960a
commit 044e23f10a
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
5 changed files with 8 additions and 4 deletions

View file

@ -103,11 +103,12 @@ function WebPlayer(props: any) {
}
}, [session.sessionId]);
const domFiles = session?.domURL?.length ?? 0
useEffect(() => {
if (!props.prefetched && session.domURL.length > 0) {
if (!props.prefetched && domFiles > 0) {
playerInst?.reinit(session);
}
}, [session.domURL.length, props.prefetched]);
}, [session, domFiles, props.prefetched]);
const {
firstVisualEvent: visualOffset,

View file

@ -15,6 +15,7 @@ function hashString(s: string): number {
}
export default class Session {
intertag = "_mobx"
sessionId: string = "";
viewed: boolean = false
duration: number = 0
@ -31,6 +32,9 @@ export default class Session {
eventsCount: number = 0
userNumericHash: number = 0
userDisplayName: string = ""
canvasURL: string[] = []
domURL: string[] = []
devtoolsURL: string[] = []
constructor() {
makeAutoObservable(this, {

View file

@ -175,6 +175,7 @@ export default class TabSessionManager {
if (!this.canvasManagers[managerId]) {
const fileId = managerId;
const delta = msg.timestamp - this.sessionStart;
const canvasNodeLinks = this.session.canvasURL.filter((url: string) => url.includes(fileId)) as string[];
const tarball = canvasNodeLinks.find((url: string) => url.includes('.tar.'));
const mp4file = canvasNodeLinks.find((url: string) => url.includes('.mp4'));

View file

@ -100,7 +100,6 @@ export default class WebPlayer extends Player {
this.targetMarker = new TargetMarker(this.screen, this.wpState)
this.inspectorController = new InspectorController(this.screen, this.wpState)
const endTime = session.duration?.valueOf() || 0
this.wpState.update({
//@ts-ignore

View file

@ -310,7 +310,6 @@ export default class Session {
frustrationIssues
).sort(sortEvents)
console.log(session.platform)
Object.assign(this, {
...session,
isMobileNative: ['ios', 'android'].includes(session.platform),