mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
fix: show ens and alias on profile popup header
This commit is contained in:
parent
e96f3ed47f
commit
edbb183242
@ -147,6 +147,9 @@ QtObject:
|
||||
|
||||
proc appReady*(self: ChatsView) {.signal.}
|
||||
|
||||
proc alias*(self: ChatsView, pubKey: string): string {.slot.} =
|
||||
generateAlias(pubKey)
|
||||
|
||||
proc userNameOrAlias*(self: ChatsView, pubKey: string): string {.slot.} =
|
||||
if self.status.chat.contacts.hasKey(pubKey):
|
||||
return status_ens.userNameOrAlias(self.status.chat.contacts[pubKey])
|
||||
|
@ -38,10 +38,10 @@ QtObject:
|
||||
generateAlias(pubKey)
|
||||
|
||||
proc name*(self: ChatItemView): string {.slot.} =
|
||||
if self.chatItem != nil:
|
||||
if self.chatItem != nil and self.chatItem.chatType.isOneToOne:
|
||||
result = self.userNameOrAlias(self.chatItem.id)
|
||||
else:
|
||||
result = self.chatItem.name
|
||||
result = ?.self.chatItem.name
|
||||
|
||||
QtProperty[string] name:
|
||||
read = name
|
||||
|
@ -11,6 +11,7 @@ ModalPopup {
|
||||
property var userName: ""
|
||||
property var fromAuthor: ""
|
||||
property var text: ""
|
||||
property var alias: ""
|
||||
|
||||
property bool showQR: false
|
||||
property bool isEnsVerified: false
|
||||
@ -23,6 +24,7 @@ ModalPopup {
|
||||
this.identicon = identiconParam
|
||||
this.text = textParam
|
||||
this.isEnsVerified = chatsModel.isEnsVerified(this.fromAuthor)
|
||||
this.alias = chatsModel.alias(this.fromAuthor)
|
||||
}
|
||||
|
||||
function openPopup(userNameParam, fromAuthorParam, identiconParam) {
|
||||
@ -65,9 +67,9 @@ ModalPopup {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: fromAuthor
|
||||
text: isEnsVerified ? alias : fromAuthor
|
||||
width: 160
|
||||
elide: Text.ElideMiddle
|
||||
elide: !isEnsVerified ? Text.ElideMiddle : Text.ElideNone
|
||||
anchors.left: profilePic.right
|
||||
anchors.leftMargin: Style.current.smallPadding
|
||||
anchors.top: profileName.bottom
|
||||
|
Loading…
x
Reference in New Issue
Block a user