This commit is contained in:
Sacha Weatherstone
2021-05-31 20:44:46 +10:00
parent 58de82b8d7
commit 78bdb2b519
10 changed files with 209 additions and 142 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ export interface MessageBoxProps {
translations: languageTemplate;
sidebarOpen: boolean;
setSidebarOpen: React.Dispatch<React.SetStateAction<boolean>>;
connection?: ISerialConnection | IHTTPConnection | IBLEConnection;
connection: ISerialConnection | IHTTPConnection | IBLEConnection;
isReady: boolean;
}
@@ -21,7 +21,7 @@ const MessageBox = (props: MessageBoxProps): JSX.Element => {
const [currentMessage, setCurrentMessage] = React.useState('');
const sendMessage = () => {
if (props.isReady) {
props.connection?.sendText(currentMessage, undefined, true);
props.connection.sendText(currentMessage, undefined, true);
setCurrentMessage('');
}
};