Scope the list files api call for better performance

This commit is contained in:
Kiril Videlov 2023-02-27 15:24:41 +01:00
parent fa24122307
commit 466277a04e
2 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ export type Session = {
activity: Activity[]; activity: Activity[];
}; };
export const listFiles = (params: { projectId: string; sessionId: string }) => export const listFiles = (params: { projectId: string; sessionId: string; paths?: string[] }) =>
invoke<Record<string, string>>('list_session_files', params); invoke<Record<string, string>>('list_session_files', params);
const list = (params: { projectId: string }) => invoke<Session[]>('list_sessions', params); const list = (params: { projectId: string }) => invoke<Session[]>('list_sessions', params);

View File

@ -226,7 +226,8 @@
deltas: uiSession.deltas, deltas: uiSession.deltas,
files: listFiles({ files: listFiles({
projectId: $project?.id, projectId: $project?.id,
sessionId: uiSession.session.id sessionId: uiSession.session.id,
paths: Object.keys(uiSession.deltas)
}) })
}; };
scrollExpandedIntoView(dateMilliseconds); scrollExpandedIntoView(dateMilliseconds);