Refactored message logic to fix issues where they desync #51

Merged
retoor merged 4 commits from :bugfix/typing-desync into main 2025-06-01 22:07:52 +02:00
Showing only changes of commit deaa7716a2 - Show all commits

View File

@ -16,9 +16,6 @@ class ChatInputComponent extends HTMLElement {
textarea = null
_value = ""
lastUpdateEvent = null
previousValue = ""
lastChange = null
changed = false
expiryTimer = null;
constructor() {
@ -26,9 +23,6 @@ class ChatInputComponent extends HTMLElement {
this.lastUpdateEvent = new Date();
this.textarea = document.createElement("textarea");
this.value = this.getAttribute("value") || "";
this.previousValue = this.value;
this.lastChange = new Date();
this.changed = false;
}
get value() {
@ -194,7 +188,6 @@ class ChatInputComponent extends HTMLElement {
if (autoCompletionHandler) {
autoCompletionHandler();
this.value = "";
this.previousValue = "";
e.target.value = "";
return;
@ -273,7 +266,6 @@ class ChatInputComponent extends HTMLElement {
app.rpc.finalizeMessage(this.messageUid)
}
this.value = "";
this.previousValue = "";
this.messageUid = null;
}