mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-16 01:12:46 +00:00
refactor(sidebar): update sessionMeta handling for session loading logic
- This fixes an issue where the sidebar was showing 6+ even when there were only 5 sessions, due to the hasMore logic not accounting for the case where there are exactly 6 sessions. It was also showing "Show more sessions" even where there were no more sessions to load. - This was because `hasMore` was sometimes `undefined` and the logic checked for hasMore !== false, which treated undefined as true. Now we explicitly check for hasMore === true to determine if there are more sessions to load.
This commit is contained in:
@@ -324,7 +324,7 @@ export function useSidebarController({
|
||||
|
||||
const loadMoreSessions = useCallback(
|
||||
async (project: Project) => {
|
||||
const canLoadMore = project.sessionMeta?.hasMore !== false;
|
||||
const canLoadMore = project.sessionMeta?.hasMore === true;
|
||||
if (!canLoadMore || loadingSessions[project.name]) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user