Skip to content

Commit c88d560

Browse files
committed
Fix filtering logic - show all when streaming, only completed when idle
1 parent a8a3707 commit c88d560

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/PinnedTodoList.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ export const PinnedTodoList: React.FC<PinnedTodoListProps> = ({ workspaceId }) =
2727
() => workspaceStore.getWorkspaceState(workspaceId).todos
2828
);
2929

30-
if (todos.length === 0) {
30+
// Get streaming state
31+
const canInterrupt = useSyncExternalStore(
32+
(callback) => workspaceStore.subscribeKey(workspaceId, callback),
33+
() => workspaceStore.getWorkspaceState(workspaceId).canInterrupt
34+
);
35+
36+
// Filter completed todos while streaming
37+
const displayTodos = canInterrupt ? todos.filter((todo) => todo.status !== "completed") : todos;
38+
39+
if (displayTodos.length === 0) {
3140
return null;
3241
}
3342

0 commit comments

Comments
 (0)