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