diff --git a/imports/NeoChat/Component/ChatBox/ChatBar.qml b/imports/NeoChat/Component/ChatBox/ChatBar.qml index 0509dd4d8..05a9f2d22 100644 --- a/imports/NeoChat/Component/ChatBox/ChatBar.qml +++ b/imports/NeoChat/Component/ChatBox/ChatBar.qml @@ -371,7 +371,7 @@ ToolBar { function complete() { documentHandler.replaceAutoComplete(completionMenu.currentDisplayText); if (completionMenu.completionType === ChatDocumentHandler.User) { - userAutocompleted[completionMenu.currentDisplayText] = completionMenu.currentUserId; + userAutocompleted[completionMenu.currentDisplayText] = completionMenu.currentItem.userId; } } } diff --git a/imports/NeoChat/Component/ChatBox/CompletionMenu.qml b/imports/NeoChat/Component/ChatBox/CompletionMenu.qml index f225ba27c..92e17c935 100644 --- a/imports/NeoChat/Component/ChatBox/CompletionMenu.qml +++ b/imports/NeoChat/Component/ChatBox/CompletionMenu.qml @@ -22,8 +22,7 @@ Popup { property alias delegate: completionListView.delegate // Autocomplee text - property string currentDisplayText: currentItem && currentItem.displayName ? currentItem.displayName : "" - property string currentUserId: currentItem && currentItem.id ? currentItem.id : "" + property string currentDisplayText: currentItem && (currentItem.displayName ?? "") property int completionType: ChatDocumentHandler.Emoji property int beginPosition: 0 @@ -78,6 +77,7 @@ Popup { id: usernameItem width: ListView.view.width ?? implicitWidth property string displayName: modelData.displayName + property string userId: modelData.id leading: Kirigami.Avatar { implicitHeight: Kirigami.Units.gridUnit implicitWidth: implicitHeight @@ -86,11 +86,6 @@ Popup { } text: modelData.displayName onClicked: completeTriggered(); - Component.onCompleted: { - completionMenu.currentUserId = Qt.binding(() => { - return modelData.id ?? ""; - }); - } } }