app: better loading (#23489)

This commit is contained in:
Brendan Allan 2026-04-20 13:17:37 +08:00 committed by GitHub
parent 84e322b0fd
commit 687b758882
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 142 additions and 107 deletions

View file

@ -31,7 +31,7 @@ function sortSessions(now: number) {
const isRootVisibleSession = (session: Session, directory: string) =>
workspaceKey(session.directory) === workspaceKey(directory) && !session.parentID && !session.time?.archived
const roots = (store: SessionStore) =>
export const roots = (store: SessionStore) =>
(store.session ?? []).filter((session) => isRootVisibleSession(session, store.path.directory))
export const sortedRootSessions = (store: SessionStore, now: number) => roots(store).sort(sortSessions(now))