From db97fbf3ebab2165f0ff3490ffec7d872b384978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Fri, 6 Jan 2023 14:09:47 +0100 Subject: [PATCH] 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 --- ui/imports/shared/status/StatusChatInput.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index d5dca3c388..353a7ab819 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -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() }