fix(StatusChatInput): return correct mention suggestions

- follow the order of properties that `ProfileUtils.displayName()` uses
elsewhere in the application
- prefer nickname or ensName over displayName if the user has them

Fixes: #8691
This commit is contained in:
Lukáš Tinkl 2023-01-06 14:09:47 +01:00 committed by Lukáš Tinkl
parent 785110b410
commit db97fbf3eb
1 changed files with 2 additions and 2 deletions

View File

@ -990,11 +990,11 @@ Rectangle {
width: messageInput.width
filter: messageInputField.text
cursorPosition: messageInputField.cursorPosition
property: ["name", "nickname", "ensName", "alias"]
property: ["nickname", "ensName", "name", "alias"]
inputField: messageInputField
onItemSelected: function (item, lastAtPosition, lastCursorPosition) {
messageInputField.forceActiveFocus();
let name = item.name.replace("@", "")
const name = item[suggestionsBox.property.find(p => !!item[p])].replace("@", "")
d.insertMention(name, item.publicKey, lastAtPosition, lastCursorPosition)
suggestionsBox.suggestionsModel.clear()
}