Skip to content

Commit

Permalink
pass user ID in the thread hooks (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarda authored Jun 3, 2024
1 parent b8b6052 commit e34776e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/app/hooks/useThreadList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function useThreadList(userId: string): ThreadListProps {
}

fetchThreads();
}, [offset]);
}, [offset, userId]);

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

const updateThread = useCallback(async (thread_id: string, name: string) => {
const saved = await client.threads.update(thread_id, {
metadata: { name, userId },
});
dispatch({ type: "add", threads: [saved] });
return saved;
}, []);
}, [userId]);

const deleteThread = useCallback(
async (thread_id: string) => {
Expand Down

0 comments on commit e34776e

Please sign in to comment.