From 145519719ba955b55885b6bfcb721d8ff520eca2 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 22 Jul 2020 15:41:27 -0400 Subject: [PATCH] fix: fix MyProfile not having the right data --- src/app/profile/core.nim | 1 + src/app/profile/views/profile_info.nim | 13 +++++++++---- ui/app/AppLayouts/Profile/ProfileLayout.qml | 7 ++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/app/profile/core.nim b/src/app/profile/core.nim index af2210c435..72cd10deec 100644 --- a/src/app/profile/core.nim +++ b/src/app/profile/core.nim @@ -41,6 +41,7 @@ proc init*(self: ProfileController, account: Account) = let appearance = status_settings.getSetting[int](Setting.Appearance) profile.appearance = appearance profile.id = pubKey + profile.address = account.keyUid self.view.addDevices(devices.getAllDevices()) self.view.setDeviceSetup(devices.isDeviceSetup()) diff --git a/src/app/profile/views/profile_info.nim b/src/app/profile/views/profile_info.nim index db96cab501..1234cc0184 100644 --- a/src/app/profile/views/profile_info.nim +++ b/src/app/profile/views/profile_info.nim @@ -1,10 +1,12 @@ import NimQml +import chronicles import ../../../status/profile/profile QtObject: type ProfileInfoView* = ref object of QObject username*: string identicon*: string + address*: string pubKey*: string appearance*: int @@ -30,6 +32,7 @@ QtObject: self.identicon = profile.identicon self.appearance = profile.appearance self.pubKey = profile.id + self.address = profile.address self.profileChanged() proc username*(self: ProfileInfoView): string {.slot.} = result = self.username @@ -53,10 +56,12 @@ QtObject: proc pubKey*(self: ProfileInfoView): string {.slot.} = self.pubKey - proc setPubKey*(self: ProfileInfoView, pubKey: string) {.slot.} = - self.pubKey = pubKey - self.profileChanged() - QtProperty[string] pubKey: read = pubKey notify = profileChanged + + proc address*(self: ProfileInfoView): string {.slot.} = self.address + + QtProperty[string] address: + read = address + notify = profileChanged diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index 742da5b34a..8b9846a981 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -39,7 +39,12 @@ SplitView { // This list needs to match LeftTab/constants.js // Would be better if we could make them match automatically - MyProfileContainer {} + MyProfileContainer { + username: profileModel.profile.username + identicon: profileModel.profile.identicon + pubkey: profileModel.profile.pubKey + address: profileModel.profile.address + } ContactsContainer {}