Skip to content

Commit 86d0d0a

Browse files
committed
fix ai chat user issue
before this, every chat by everyone will be shown, which is a bug
1 parent 31707aa commit 86d0d0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peachide/src/components/ai/AIChatButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function AIChatButton({ materialId, className = '' }: AIChatButtonProps)
4646
const [showMaterialPrompt, setShowMaterialPrompt] = useState(true);
4747
const [showPresetDialog, setShowPresetDialog] = useState(false);
4848
const [showChatList, setShowChatList] = useState(false);
49-
const { token } = useUserContext();
49+
const { token, userId } = useUserContext();
5050
const [editingChatId, setEditingChatId] = useState<string | null>(null);
5151
const [editingTitle, setEditingTitle] = useState<string>('');
5252

@@ -332,7 +332,7 @@ export function AIChatButton({ materialId, className = '' }: AIChatButtonProps)
332332
New Chat
333333
</Button>
334334
{chats.map((chat) => (
335-
isNotQuiz(chat) && (
335+
isNotQuiz(chat) && chat.user_id === userId && (
336336
<div key={chat.chat_id} className="flex items-center group">
337337
{editingChatId === chat.chat_id ? (
338338
<input

0 commit comments

Comments
 (0)