diff --git a/net/web/src/User/Conversation/AddTopic/AddTopic.jsx b/net/web/src/User/Conversation/AddTopic/AddTopic.jsx index b8722a7c..335ab2f2 100644 --- a/net/web/src/User/Conversation/AddTopic/AddTopic.jsx +++ b/net/web/src/User/Conversation/AddTopic/AddTopic.jsx @@ -27,12 +27,21 @@ export function AddTopic() { actions.addTopic(); } + const onKey = (e) => { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + if (state.messageText) { + actions.addTopic(); + } + } + } + return (
- actions.setMessageText(e.target.value)} value={state.messageText} />
diff --git a/net/web/src/User/Conversation/AddTopic/useAddTopic.hook.js b/net/web/src/User/Conversation/AddTopic/useAddTopic.hook.js index d242933c..969b1ca0 100644 --- a/net/web/src/User/Conversation/AddTopic/useAddTopic.hook.js +++ b/net/web/src/User/Conversation/AddTopic/useAddTopic.hook.js @@ -64,6 +64,7 @@ export function useAddTopic() { else { await addChannelTopic(app.state.token, channel, message, []); } + updateState({ messageText: null, messageColor: null, messageSize: null, backgroundColor: null }); } catch(err) { window.alert(err);