Browse Source

quick fix

develop
Rob Colbert 1 year ago
parent
commit
bb9fe034ce
  1. 10
      client/js/chat-client.js

10
client/js/chat-client.js

@ -63,6 +63,10 @@ export class ChatApp extends DtpApp {
this.emojiPicker.addEventListener('emoji-click', this.onEmojiPicked.bind(this));
}
this.pendingFiles = {
images: [ ],
videos: [ ],
};
this.dragFeedback = document.querySelector('.dtp-drop-feedback');
window.addEventListener('dtp-load', this.onDtpLoad.bind(this));
@ -274,7 +278,7 @@ export class ChatApp extends DtpApp {
// set focus back to chat input
this.chat.imageFiles.value = null;
this.chat.videoFile = null;
this.chat.videoFile.value = null;
this.chat.input.focus();
this.chat.sendButton.setAttribute('disabled', '');
@ -365,7 +369,9 @@ export class ChatApp extends DtpApp {
async onChatMessage (message) {
const isAtBottom = this.chat.isAtBottom;
this.chat.messageList.insertAdjacentHTML('beforeend', message.html);
this.audio.playSound(ChatApp.SFX_CHAT_MESSAGE);
if (!this.haveFocus) {
this.audio.playSound(ChatApp.SFX_CHAT_MESSAGE);
}
this.scrollChatToBottom(isAtBottom);
if (!this.haveFocus && (this.notificationPermission === 'granted')) {

Loading…
Cancel
Save