fix: [chat] @mentions no longer working

fixup undefined references which caused the users model to become
empty

Fixes #11005
This commit is contained in:
Lukáš Tinkl 2023-06-08 20:35:18 +02:00 committed by Jonathan Rainville
parent 9aeba367df
commit 0f9f5de267
2 changed files with 3 additions and 5 deletions

View File

@ -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)

View File

@ -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()