mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
Filter out empty sessions
This commit is contained in:
parent
6c77303172
commit
a761be80a5
1 changed files with 12 additions and 7 deletions
|
|
@ -72,13 +72,18 @@ function SessionPicker({
|
|||
};
|
||||
}, []);
|
||||
|
||||
// Filter sessions by current branch if filter is enabled
|
||||
const filteredSessions =
|
||||
filterByBranch && currentBranch
|
||||
? sessionState.sessions.filter(
|
||||
(session) => session.gitBranch === currentBranch,
|
||||
)
|
||||
: sessionState.sessions;
|
||||
// Filter sessions: exclude empty sessions (0 messages) and optionally by branch
|
||||
const filteredSessions = sessionState.sessions.filter((session) => {
|
||||
// Always exclude sessions with no messages
|
||||
if (session.messageCount === 0) {
|
||||
return false;
|
||||
}
|
||||
// Apply branch filter if enabled
|
||||
if (filterByBranch && currentBranch) {
|
||||
return session.gitBranch === currentBranch;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
const hasSentinel = sessionState.hasMore;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue