From 0328aa2d111ed41fb69f2fccaa3afb10a9aff31d Mon Sep 17 00:00:00 2001 From: Justin Ferrari <‘justinwesleyferrari@gmail.com’> Date: Thu, 17 Nov 2022 20:09:09 -0500 Subject: [PATCH] Started bug fixing --- .../plugins/core/components/ChatPage.js | 77 ++++++++----------- .../plugins/core/components/ChatScroller.js | 10 +-- 2 files changed, 37 insertions(+), 50 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index 0a6b6cac..d2749d9c 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -59,11 +59,11 @@ class ChatPage extends LitElement { editedMessageObj: { type: Object }, iframeHeight: { type: Number }, chatMessageSize: { type: Number}, - imageFile: {type: Object}, - isUploadingImage: {type: Boolean}, + imageFile: { type: Object }, + isUploadingImage: { type: Boolean }, caption: { type: String }, - chatEditor: {type: Object}, - chatEditorNewChat: {type: Object} + chatEditor: { type: Object }, + chatEditorNewChat: { type: Object } } } @@ -144,7 +144,6 @@ class ChatPage extends LitElement { width: 92%; } - .senderName { margin: 0; color: var(--mdc-theme-primary); @@ -234,8 +233,8 @@ class ChatPage extends LitElement { overflow: hidden; justify-content: center; background: white; - padding: 5px; - border-radius: 1px; + padding: 5px; + border-radius: 1px; } .chatbar-caption { @@ -435,7 +434,6 @@ class ChatPage extends LitElement { .dialog-container { position: relative; display: flex; - flex-direction: column; align-items: center; padding: 0 10px; gap: 10px; @@ -523,29 +521,21 @@ class ChatPage extends LitElement { ${this.imageFile && html` dialog-img `} - -
+
this.setChatEditorNewChat(editor)} - .chatEditor=${this.chatEditorNewChat} - .imageFile=${this.imageFile} - .insertImage=${this.insertImage} - - .editedMessageObj=${this.editedMessageObj} - - ?isLoading=${this.isLoading} - ?isLoadingMessages=${this.isLoadingMessages} - > - - - -
+ iframeId="newChat" + ?hasGlobalEvents=${false} + placeholder=${this.chatEditorPlaceholder} + ._sendMessage=${this._sendMessage} + .setChatEditor=${(editor)=> this.setChatEditorNewChat(editor)} + .chatEditor=${this.chatEditorNewChat} + .imageFile=${this.imageFile} + .insertImage=${this.insertImage} + .editedMessageObj=${this.editedMessageObj} + ?isLoading=${this.isLoading} + ?isLoadingMessages=${this.isLoadingMessages}> + +
${this.chatMessageSize >= 750 ? html`
@@ -617,22 +607,21 @@ class ChatPage extends LitElement {
`}
- this.setChatEditor(editor)} .chatEditor=${this.chatEditor} - .imageFile=${this.imageFile} - .insertImage=${this.insertImage} - .chatMessageInput=${this.chatMessageInput} - .editedMessageObj=${this.editedMessageObj} - .mirrorChatInput=${this.mirrorChatInput} - ?isLoading=${this.isLoading} - ?isLoadingMessages=${this.isLoadingMessages} - > - + .imageFile=${this.imageFile} + .insertImage=${this.insertImage} + .chatMessageInput=${this.chatMessageInput} + .editedMessageObj=${this.editedMessageObj} + .mirrorChatInput=${this.mirrorChatInput} + ?isLoading=${this.isLoading} + ?isLoadingMessages=${this.isLoadingMessages}> +
diff --git a/qortal-ui-plugins/plugins/core/components/ChatScroller.js b/qortal-ui-plugins/plugins/core/components/ChatScroller.js index 173b76b6..434d295e 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatScroller.js +++ b/qortal-ui-plugins/plugins/core/components/ChatScroller.js @@ -125,12 +125,10 @@ class ChatScroller extends LitElement { this.upObserverElement = this.shadowRoot.getElementById('upObserver'); this.downObserverElement = this.shadowRoot.getElementById('downObserver'); // Intialize Observers - this.upElementObserver() - this.downElementObserver() - await this.updateComplete - this.viewElement.scrollTop = this.viewElement.scrollHeight + 50 - - + this.upElementObserver(); + this.downElementObserver(); + await this.updateComplete; + this.viewElement.scrollTop = this.viewElement.scrollHeight + 50; } _getOldMessage(_scrollElement) {