From 0f9f5de26717ef802f4b26241e4f34fb04710c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Thu, 8 Jun 2023 20:35:18 +0200 Subject: [PATCH] fix: [chat] @mentions no longer working fixup undefined references which caused the users model to become empty Fixes #11005 --- ui/app/AppLayouts/Chat/views/ChatColumnView.qml | 4 ++-- ui/imports/shared/status/StatusChatInput.qml | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index 90ff55af44..507dd66f50 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -40,7 +40,7 @@ Item { property bool stickersLoaded: false readonly property var contactDetails: rootStore ? rootStore.oneToOneChatContact : null - readonly property bool isUserAdded: root.contactDetails && root.contactDetails.isAdded + readonly property bool isUserAdded: !!root.contactDetails && root.contactDetails.isAdded signal openStickerPackPopup(string stickerPackId) @@ -241,7 +241,7 @@ Item { root.rootStore.isUserAllowedToSendMessage store: root.rootStore - usersStore: d.usersStore + usersStore: d.activeUsersStore textInput.placeholderText: { if (d.activeChatContentModule.chatDetails.blocked) diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 650b2eaacb..06cada14db 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -653,7 +653,7 @@ Rectangle { if ((event.modifiers & Qt.ControlModifier) || (event.modifiers & Qt.MetaModifier)) // these are likely shortcuts with no meaningful text return - if (event.key === Qt.Key_Backspace && d.textFormatMenu.opened) { + if (event.key === Qt.Key_Backspace && (!!d.textFormatMenu && d.textFormatMenu.opened)) { d.textFormatMenu.close() } // the text doesn't get registered to the textarea fast enough @@ -1138,8 +1138,6 @@ Rectangle { id: textFormatMenuComponent StatusTextFormatMenu { - id: textFormatMenu - onClosed: { messageInputField.deselect() destroy()