From 0dc1f5ec79940cc4c6e76b49cabffd79e28e38a8 Mon Sep 17 00:00:00 2001 From: Justin Ferrari <‘justinwesleyferrari@gmail.com’> Date: Fri, 16 Dec 2022 11:41:51 -0500 Subject: [PATCH] Fixed private message bugs --- .../plugins/core/components/ChatPage.js | 8 +- .../plugins/core/components/ChatTextEditor.js | 18 +- .../plugins/core/components/WrapperModal.js | 5 +- .../core/messaging/q-chat/q-chat.src.js | 207 ++++++++++++------ 4 files changed, 153 insertions(+), 85 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index 48edbb1f..8cdf5510 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -673,9 +673,9 @@ class ChatPage extends LitElement { `: ''} { - this.chatEditorNewChat.resetValue() - this.removeImage() + .onClickFunc=${() => { + this.chatEditorNewChat.resetValue(); + this.removeImage(); } } style=${(this.imageFile && !this.isUploadingImage) ? "display: block" : "display: none"}>
@@ -724,7 +724,7 @@ class ChatPage extends LitElement {
{ + .onClickFunc=${() => { this.openForwardOpen = false this.forwardActiveChatHeadUrl = "" } } diff --git a/qortal-ui-plugins/plugins/core/components/ChatTextEditor.js b/qortal-ui-plugins/plugins/core/components/ChatTextEditor.js index 76b9d39d..7db0986c 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatTextEditor.js +++ b/qortal-ui-plugins/plugins/core/components/ChatTextEditor.js @@ -174,9 +174,12 @@ class ChatTextEditor extends LitElement {
-
{ - this.preventUserSendingImage(e) - }}> +
{ + this.preventUserSendingImage(e) + }}> this.emojiPicker.togglePicker(this.emojiPickerHandler)); + this.emojiPickerHandler.addEventListener('click', () => { + console.log("yo what's up?") + this.emojiPicker.togglePicker(this.emojiPickerHandler) + }); await this.updateComplete; this.initChatEditor(); @@ -366,6 +372,7 @@ class ChatTextEditor extends LitElement { return; }; this.chatMessageSize = 0; + this.chatEditor.updateMirror(); this._sendMessage(); } @@ -693,11 +700,10 @@ class ChatTextEditor extends LitElement { }, 0); res(); }) + // Handle Enter if (e.keyCode === 13 && !e.shiftKey) { - // Update Mirror - editor.updateMirror(); if (editor.state() === 'false') return false; if (editorConfig.iframeId === 'newChat') { diff --git a/qortal-ui-plugins/plugins/core/components/WrapperModal.js b/qortal-ui-plugins/plugins/core/components/WrapperModal.js index 23b6c040..96b22142 100644 --- a/qortal-ui-plugins/plugins/core/components/WrapperModal.js +++ b/qortal-ui-plugins/plugins/core/components/WrapperModal.js @@ -5,7 +5,8 @@ import { wrapperModalStyles } from './WrapperModal-css.js' export class WrapperModal extends LitElement { static get properties() { return { - removeImage: { type: Function }, + onClickFunc: { attribute: false }, + closePrivateMessage: { attribute: false }, } } @@ -15,7 +16,7 @@ export class WrapperModal extends LitElement { return html`
{ - this.removeImage() + this.onClickFunc(); }}>