fix(tasks): eliminate duplicate task entries by stabilizing WS listener and deduplicating task state
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 55s

This commit is contained in:
sandrodach committed 2026-10-25 10:52:34 +01:00
1 parent af7a9eb200
commit 6e09888a44
2 files changed
+40 -14

No files matched your search

+5 -2
View File
@@ -208,7 +208,7 @@ export const App: React.FC = () => {
} else {
disconnectWebSocket();
}
}, [user]);
}, [user?.id]);
// Refresh stats on task/doc real-time events
useEffect(() => {
@@ -253,7 +253,10 @@ export const App: React.FC = () => {
target: 'inbox' | 'task' | 'list_item' | 'document' = 'inbox'
) => {
if (target === 'inbox' && thought.status === 'inbox') {
setDeck((prev) => [thought, ...prev]);
setDeck((prev) => {
if (prev.some((t) => t.id === thought.id)) return prev;
return [thought, ...prev];
});
setStats((prev) => ({ ...prev, inboxCount: prev.inboxCount + 1 }));
} else if (target === 'document' && thought.convertedRefId) {
setSelectedDocId(thought.convertedRefId);