add pageId onto context.pages

This commit is contained in:
Simon Knott 2024-09-06 15:42:50 +02:00
parent 9fbf0ded35
commit 03723b3e99
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
3 changed files with 3 additions and 1 deletions

View file

@ -41,6 +41,7 @@ export type ContextEntry = {
}; };
export type PageEntry = { export type PageEntry = {
pageId: string,
screencastFrames: { screencastFrames: {
sha1: string, sha1: string,
pageId: string, pageId: string,

View file

@ -58,6 +58,7 @@ export class TraceModernizer {
let pageEntry = this._pageEntries.get(pageId); let pageEntry = this._pageEntries.get(pageId);
if (!pageEntry) { if (!pageEntry) {
pageEntry = { pageEntry = {
pageId,
screencastFrames: [], screencastFrames: [],
}; };
this._pageEntries.set(pageId, pageEntry); this._pageEntries.set(pageId, pageEntry);

View file

@ -149,7 +149,7 @@ function indexModel(context: ContextEntry) {
for (let i = 0; i < context.actions.length; ++i) { for (let i = 0; i < context.actions.length; ++i) {
const action = context.actions[i] as any; const action = context.actions[i] as any;
action[contextSymbol] = context; action[contextSymbol] = context;
action[pageSymbol] = context.pages.find(page => page.screencastFrames.find(frame => frame.pageId === action.pageId)); action[pageSymbol] = context.pages.find(page => page.pageId === action.pageId);
} }
let lastNonRouteAction = undefined; let lastNonRouteAction = undefined;
for (let i = context.actions.length - 1; i >= 0; i--) { for (let i = context.actions.length - 1; i >= 0; i--) {