Skip to content

Commit 9961b93

Browse files
committed
fix(app): allow Load More to refetch when trimmed session cache is insufficient (closes anomalyco#23026)
1 parent 72d7cb7 commit 9961b93

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/app/src/context/global-sync.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,11 @@ function createGlobalSync() {
198198
setStore("session", reconcile(next, { key: "id" }))
199199
cleanupDroppedSessionCaches(store, setStore, next, setSessionTodo)
200200
}
201-
children.unpin(directory)
202-
return
201+
const rootCount = next.filter((s) => !s.parentID).length
202+
if (rootCount >= store.limit || store.sessionTotal <= rootCount) {
203+
children.unpin(directory)
204+
return
205+
}
203206
}
204207

205208
const limit = Math.max(store.limit + SESSION_RECENT_LIMIT, SESSION_RECENT_LIMIT)

0 commit comments

Comments
 (0)