create conv message fix

This commit is contained in:
2026-01-28 03:13:40 +01:00
parent 7a88a7e04e
commit e7a283b39e
2 changed files with 14 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ function MainApp() {
<h2>Dashboard</h2>
<section className="main">
<AdminWidget/>
<RoomWidget roomlist={rooms}/>
<ChatWidget convlist={conversations}/>
<InventoryWidget/>

View File

@@ -47,6 +47,7 @@ return (
Add users
</button>
<button
hidden={showCreateConv}
onClick={() => setShowCreateConv(v => !v)}
>
Create Conv
@@ -65,6 +66,12 @@ return (
/>
)}
{showCreateConv && (
<CreateConvMenu
onSend={createConversation}
/>
)}
{activeConvId && (
<MessagesBox
conv_id={activeConvId}
@@ -176,20 +183,20 @@ function AddUsersMenu({ convId, usersById, fetchConvUsers, onValidate, onClose }
function CreateConvMenu({onSend}) {
const [nametext, setNameText] = useState("");
const [nameText, setNameText] = useState("");
const handleSend = () =>{
if (!nametext.trim()) return;
if (!nameText.trim()) return;
onSend(nametext);
onSend(nameText);
setText("");
setNameText("");
};
return (
<div className="createConvBox">
<input
value= {text}
onChange= {element => setText(element.target.value)}
value= {nameText}
onChange= {element => setNameText(element.target.value)}
placeholder="Ma Conversation"
/>
<button onClick= {handleSend}>Send</button>