fix(@desktop): show compressed multiformat public keys

closes: #5181
This commit is contained in:
Patryk Osmaczko 2022-03-30 09:09:39 +02:00 committed by Iuri Matias
parent 53c38624ef
commit fa11b3bf67
6 changed files with 8 additions and 8 deletions

View File

@ -110,7 +110,7 @@ SettingsPageLayout {
}
return !model.name.endsWith(".eth") ? model.name : Utils.removeStatusEns(model.name)
}
subTitle: model.id.substring(0, 5) + "..." + model.id.substring(model.id.length - 3)
subTitle: Utils.getElidedCompressedPk(model.id)
statusListItemIcon {
name: model.name

View File

@ -80,6 +80,7 @@ Item {
icon.letterSize: 32
icon.color: Theme.palette.miscColor5
icon.charactersLen: 2
image.isIdenticon: false
image.source: uploadProfilePicPopup.selectedImage
ringSettings { ringSpecModel: Utils.getColorHashAsJson(root.pubKey) }
}
@ -122,7 +123,7 @@ Item {
StyledText {
id: chatKeyTxt
color: Style.current.secondaryText
text: "Chatkey:" + root.pubKey
text: qsTr("Chatkey:") + " " + Utils.getCompressedPk(root.pubKey)
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
Layout.alignment: Qt.AlignHCenter

View File

@ -130,7 +130,7 @@ ColumnLayout {
Layout.preferredWidth: root.profileContentWidth
title: qsTr("Chat key")
subTitle: root.profileStore.pubkey
subTitle: Utils.getCompressedPk(root.profileStore.pubkey)
subTitleComponent.elide: Text.ElideMiddle
subTitleComponent.width: 320
subTitleComponent.font.family: Theme.palette.monoFont.name

View File

@ -79,8 +79,7 @@ Item {
visible: root.pubkeyVisible
text: pubkey.substring(0, 10) + "..." + pubkey.substring(
pubkey.length - 4)
text: Utils.getElidedCompressedPk(pubkey)
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Style.current.asideTextFontSize

View File

@ -71,7 +71,7 @@ StatusModal {
}
header.title: userDisplayName
header.subTitle: userIsEnsVerified ? userName : userPublicKey
header.subTitle: userIsEnsVerified ? userName : Utils.getElidedCompressedPk(userPublicKey)
header.subTitleElide: Text.ElideMiddle
headerActionButton: StatusFlatRoundButton {
@ -171,7 +171,7 @@ StatusModal {
StatusDescriptionListItem {
title: qsTr("Chat key")
subTitle: userPublicKey
subTitle: Utils.getCompressedPk(userPublicKey)
subTitleComponent.elide: Text.ElideMiddle
subTitleComponent.width: 320
subTitleComponent.font.family: Theme.palette.monoFont.name

View File

@ -630,7 +630,7 @@ QtObject {
return ""
}
let compressedPk = getCompressedPk(publicKey)
return compressedPk.substr(3, 3) + "..." + compressedPk.substr(compressedPk.length - 3)
return compressedPk.substr(0, 6) + "..." + compressedPk.substr(compressedPk.length - 3)
}
function getTimeDifference(d1, d2) {