From 10d810ccaa3cd4fe88ec4088b271a8bcda1704ce Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Wed, 12 Jun 2024 17:38:52 +0200 Subject: [PATCH] submit messages on enter --- src/App.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 1331c32..7ea1476 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -212,6 +212,13 @@ function App() { } }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const checkForEnter = (e: any) => { + if (e.key === 'Enter') { + sendMessage() + } + } + const createUser = async () => { try { const name = await CreateUser(usernameInput); @@ -456,6 +463,7 @@ function App() {