maintenance/clean-up-messages #65
| @ -298,7 +298,9 @@ textToLeetAdvanced(text) { | |||||||
|     this.appendChild(this.uploadButton); |     this.appendChild(this.uploadButton); | ||||||
| 
 | 
 | ||||||
|     this.textarea.addEventListener("blur", () => { |     this.textarea.addEventListener("blur", () => { | ||||||
|       this.updateFromInput(""); |       this.updateFromInput(this.value, true).then( | ||||||
|  |           this.updateFromInput("") | ||||||
|  |       ) | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     this.subscribe("file-uploads-done", (data)=>{ |     this.subscribe("file-uploads-done", (data)=>{ | ||||||
| @ -417,7 +419,7 @@ textToLeetAdvanced(text) { | |||||||
|    |    | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   updateFromInput(value) { |   updateFromInput(value, isFinal = false) { | ||||||
| 
 | 
 | ||||||
|     this.value = value; |     this.value = value; | ||||||
| 
 | 
 | ||||||
| @ -425,7 +427,7 @@ textToLeetAdvanced(text) { | |||||||
| 
 | 
 | ||||||
|     if (this.liveType && value[0] !== "/") { |     if (this.liveType && value[0] !== "/") { | ||||||
|       const messageText = this.replaceMentionsWithAuthors(value); |       const messageText = this.replaceMentionsWithAuthors(value); | ||||||
|       this.messageUid = this.sendMessage(this.channelUid, messageText, !this.liveType); |       this.messageUid = this.sendMessage(this.channelUid, messageText, !this.liveType || isFinal); | ||||||
|       return this.messageUid; |       return this.messageUid; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -191,9 +191,9 @@ class MessageList extends HTMLElement { | |||||||
|   } |   } | ||||||
|   scrollToBottom(force = false, behavior= 'smooth') { |   scrollToBottom(force = false, behavior= 'smooth') { | ||||||
|     if (force || this.isScrolledToBottom()) { |     if (force || this.isScrolledToBottom()) { | ||||||
|       this.firstElementChild.scrollIntoView({ behavior, block: 'end' }); |       this.firstElementChild.scrollIntoView({ behavior, block: 'start' }); | ||||||
|       setTimeout(() => { |       setTimeout(() => { | ||||||
|         this.firstElementChild.scrollIntoView({ behavior, block: 'end' }); |         this.firstElementChild.scrollIntoView({ behavior, block: 'start' }); | ||||||
|       }, 200); |       }, 200); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -115,7 +115,7 @@ app.starField.renderWord("H4x0r 1337") | |||||||
|         {% endif %} |         {% endif %} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|       document.addEventListener("keydown", async() => { |       document.addEventListener("keydown", async(event) => { | ||||||
|         if(prevKey == "Escape"){ |         if(prevKey == "Escape"){ | ||||||
|             document.querySelector("chat-input").querySelector("textarea").value = ""; |             document.querySelector("chat-input").querySelector("textarea").value = ""; | ||||||
|         }   |         }   | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user