filter out empty thread

This commit is contained in:
Andrew Pareles 2025-01-15 23:52:32 -08:00
parent 433884b36c
commit 9756ab6d16

View file

@ -28,7 +28,9 @@ export const SidebarThreadSelector = () => {
const { allThreads } = threadsState
// sorted by most recent to least recent
const sortedThreadIds = Object.keys(allThreads ?? {}).sort((threadId1, threadId2) => allThreads![threadId1].lastModified > allThreads![threadId2].lastModified ? -1 : 1)
const sortedThreadIds = Object.keys(allThreads ?? {})
.sort((threadId1, threadId2) => allThreads![threadId1].lastModified > allThreads![threadId2].lastModified ? -1 : 1)
.filter(threadId => allThreads![threadId].messages.length !== 0)
return (
<div className="flex p-2 flex-col mb-2 gap-y-1 max-h-[400px] overflow-y-auto">