diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index 5efa10a6..c2d5690b 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -24,6 +24,7 @@ import { replaceMessagesEdited } from '../../utils/replace-messages-edited.js'; import { publishData } from '../../utils/publish-image.js'; import WebWorker from 'web-worker:./computePowWorker.js'; import WebWorkerImage from 'web-worker:./computePowWorkerImage.js'; +import { EmojiPicker } from 'emoji-picker-js'; // const messagesCache = localForage.createInstance({ @@ -550,6 +551,15 @@ class ChatPage extends LitElement { this.uid = new ShortUniqueId() this.userLanguage = "" this.lastMessageRefVisible = false + this.emojiPicker = new EmojiPicker({ + style: "twemoji", + twemojiBaseUrl: '/emoji/', + showPreview: false, + showVariants: false, + showAnimation: false, + position: 'top-start', + boxShadow: 'rgba(4, 4, 5, 0.15) 0px 0px 0px 1px, rgba(0, 0, 0, 0.24) 0px 8px 16px 0px' + }); } render() { @@ -862,6 +872,7 @@ class ChatPage extends LitElement { .focusChatEditor=${() => this.focusChatEditor()} .sendMessage=${(val) => this._sendMessage(val)} .showLastMessageRefScroller=${(val) => this.showLastMessageRefScroller(val)} + .emojiPicker=${this.emojiPicker} > ` diff --git a/qortal-ui-plugins/plugins/core/components/ChatScroller.js b/qortal-ui-plugins/plugins/core/components/ChatScroller.js index 6f534672..4c8c0882 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatScroller.js +++ b/qortal-ui-plugins/plugins/core/components/ChatScroller.js @@ -17,6 +17,7 @@ import { EmojiPicker } from 'emoji-picker-js'; import { cropAddress } from "../../utils/cropAddress"; const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) +let toggledMessage = {} class ChatScroller extends LitElement { static get properties() { return { @@ -30,6 +31,7 @@ class ChatScroller extends LitElement { focusChatEditor: {attribute: false}, sendMessage: {attribute: false}, showLastMessageRefScroller: { type: Function }, + emojiPicker: { attribute: false } } } @@ -41,16 +43,7 @@ class ChatScroller extends LitElement { this._upObserverhandler = this._upObserverhandler.bind(this) this._downObserverHandler = this._downObserverHandler.bind(this) this.myAddress = window.parent.reduxStore.getState().app.selectedAddress.address - this.hideMessages = JSON.parse(localStorage.getItem("MessageBlockedAddresses") || "[]") - this.emojiPicker = new EmojiPicker({ - style: "twemoji", - twemojiBaseUrl: '/emoji/', - showPreview: false, - showVariants: false, - showAnimation: false, - position: 'top-start', - boxShadow: 'rgba(4, 4, 5, 0.15) 0px 0px 0px 1px, rgba(0, 0, 0, 0.24) 0px 8px 16px 0px' - }); + this.hideMessages = JSON.parse(localStorage.getItem("MessageBlockedAddresses") || "[]") } @@ -77,7 +70,6 @@ class ChatScroller extends LitElement { } return messageArray; }, []) - return html`