Skip to content

Commit e34776e

Browse files
authored
pass user ID in the thread hooks (#320)
1 parent b8b6052 commit e34776e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/app/hooks/useThreadList.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function useThreadList(userId: string): ThreadListProps {
6767
}
6868

6969
fetchThreads();
70-
}, [offset]);
70+
}, [offset, userId]);
7171

7272
const loadMoreThreads = useCallback(() => {
7373
if (areThreadsLoading) {
@@ -80,15 +80,15 @@ export function useThreadList(userId: string): ThreadListProps {
8080
const saved = await client.threads.create({ metadata: { name, userId } });
8181
dispatch({ type: "add", threads: [saved] });
8282
return saved;
83-
}, []);
83+
}, [userId]);
8484

8585
const updateThread = useCallback(async (thread_id: string, name: string) => {
8686
const saved = await client.threads.update(thread_id, {
8787
metadata: { name, userId },
8888
});
8989
dispatch({ type: "add", threads: [saved] });
9090
return saved;
91-
}, []);
91+
}, [userId]);
9292

9393
const deleteThread = useCallback(
9494
async (thread_id: string) => {

0 commit comments

Comments
 (0)