Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qryptchat-web",
"private": true,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"bin": {
"qc": "./bin/qc.js",
Expand Down
3 changes: 2 additions & 1 deletion src/app/api/chat/conversations/[id]/participants/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export async function GET(request, { params } = {}) {
id,
username,
display_name,
avatar_url
avatar_url,
account_type
)
`)
.eq('conversation_id', conversationId)
Expand Down
18 changes: 17 additions & 1 deletion src/lib/components/chat/MessageInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,23 @@ export default function MessageInput({ conversationId, disabled = false }) {
);

// Voice mode: talk to the chat (your agents) and hear the replies.
const activeConversation = conversations?.find((c) => c.id === conversationId);
// The chat's members, loaded here: the sidebar keeps its own chat list, so the
// store's copy can be empty, and then the mic never knew the chat had agents.
const [members, setMembers] = useState(null);
useEffect(() => {
setMembers(null);
if (!conversationId) return;
let stale = false;
fetch(`/api/chat/conversations/${encodeURIComponent(conversationId)}/participants`)
.then((r) => (r.ok ? r.json() : null))
.then((d) => { if (!stale && Array.isArray(d?.participants)) setMembers(d.participants); })
.catch(() => {});
return () => { stale = true; };
}, [conversationId]);
const storedConversation = conversations?.find((c) => c.id === conversationId);
const activeConversation = members
? { ...(storedConversation || { id: conversationId }), participants: members }
: storedConversation;
const voice = useVoiceMode({
conversation: activeConversation,
messages,
Expand Down
Loading