This commit is contained in:
Félix Malfait
2026-04-01 22:42:02 +02:00
parent 4a010dbf02
commit c96f0433ba
2 changed files with 11 additions and 12 deletions
@@ -31,7 +31,7 @@ export const AgentChatThreadInitializationEffect = () => {
agentChatThreadsLoadingState,
);
const store = useStore();
const threads = useAtomStateValue(agentChatThreadsSelector);
const agentChatThreads = useAtomStateValue(agentChatThreadsSelector);
const storeEntry = useAtomValue(
metadataStoreState.atomFamily('agentChatThreads'),
);
@@ -95,15 +95,14 @@ export const AgentChatThreadInitializationEffect = () => {
setAgentChatUsage(null);
}
}, [
currentAIChatThread,
threads,
storeEntry.status,
setCurrentAIChatThread,
setAgentChatInput,
setCurrentAIChatThreadTitle,
setAgentChatUsage,
store,
]);
currentAIChatThread,
storeEntry.status,
setCurrentAIChatThread,
setAgentChatInput,
setCurrentAIChatThreadTitle,
setAgentChatUsage,
store
]);
return null;
};
@@ -6,7 +6,7 @@ import { metadataStoreState } from '@/metadata-store/states/metadataStoreState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
export const useChatThreads = () => {
const allThreads = useAtomStateValue(agentChatThreadsSelector);
const agentChatThreads = useAtomStateValue(agentChatThreadsSelector);
const storeEntry = useAtomValue(
metadataStoreState.atomFamily('agentChatThreads'),
);
@@ -17,7 +17,7 @@ export const useChatThreads = () => {
(a, b) =>
new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(),
),
[allThreads],
[],
);
return {