mobile hackery

This commit is contained in:
Ginger Wong
2020-06-15 15:45:55 -07:00
parent 08d20a1096
commit 4497cc86c2
6 changed files with 60 additions and 6 deletions
+4 -2
View File
@@ -81,7 +81,7 @@ class Messaging {
this.inputChangeUserName.addEventListener("keydown", this.handleUsernameKeydown.bind(this));
this.formMessageInput.addEventListener("keydown", this.handleMessageInputKeydown.bind(this));
this.btnSubmitMessage.addEventListener("click", this.handleSubmitChatButton.bind(this));
if (isAndroidMobile && window.screen.width < 860) {
if (isAndroidMobile && window.screen.width <= 860) {
this.formMessageInput.addEventListener("focus", this.handleKeyboardAppear.bind(this));
this.formMessageInput.addEventListener("blur", this.handleKeyboardOut.bind(this));
}
@@ -203,7 +203,9 @@ class Messaging {
id: uuidv4(),
});
const messageJSON = JSON.stringify(message);
window.ws.send(messageJSON);
if (window && window.ws) {
window.ws.send(messageJSON);
}
// clear out things.
this.formMessageInput.value = "";