diff --git a/zenoh-ts/examples/chat/src/main.ts b/zenoh-ts/examples/chat/src/main.ts index 5789ee0..207abe3 100644 --- a/zenoh-ts/examples/chat/src/main.ts +++ b/zenoh-ts/examples/chat/src/main.ts @@ -52,6 +52,8 @@ document.addEventListener('DOMContentLoaded', () => { chatLog.scrollTop = chatLog.scrollHeight; // Scroll to the latest message connectButton.style.display = 'none'; disconnectButton.style.display = 'inline-block'; + messageInput.disabled = false; + sendButton.disabled = false; } function onDisconnect(chatSession: ChatSession) { @@ -59,8 +61,13 @@ document.addEventListener('DOMContentLoaded', () => { chatLog.innerHTML = ''; connectButton.style.display = 'inline-block'; disconnectButton.style.display = 'none'; + messageInput.disabled = true; + sendButton.disabled = true; } + messageInput.disabled = true; + sendButton.disabled = true; + connectButton?.addEventListener('click', () => { log_catch(async () => { let user = ChatUser.fromString(usernameInput.value);