From 466277a04ef802ad07dc315d3ca426300beda7b3 Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Mon, 27 Feb 2023 15:24:41 +0100 Subject: [PATCH] Scope the list files api call for better performance --- src/lib/sessions.ts | 2 +- src/routes/projects/[projectId]/timeline/+page.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/sessions.ts b/src/lib/sessions.ts index dc46bcd9a..d65f638db 100644 --- a/src/lib/sessions.ts +++ b/src/lib/sessions.ts @@ -21,7 +21,7 @@ export type Session = { activity: Activity[]; }; -export const listFiles = (params: { projectId: string; sessionId: string }) => +export const listFiles = (params: { projectId: string; sessionId: string; paths?: string[] }) => invoke>('list_session_files', params); const list = (params: { projectId: string }) => invoke('list_sessions', params); diff --git a/src/routes/projects/[projectId]/timeline/+page.svelte b/src/routes/projects/[projectId]/timeline/+page.svelte index 27ad105bc..73fc78d99 100644 --- a/src/routes/projects/[projectId]/timeline/+page.svelte +++ b/src/routes/projects/[projectId]/timeline/+page.svelte @@ -226,7 +226,8 @@ deltas: uiSession.deltas, files: listFiles({ projectId: $project?.id, - sessionId: uiSession.session.id + sessionId: uiSession.session.id, + paths: Object.keys(uiSession.deltas) }) }; scrollExpandedIntoView(dateMilliseconds);