fix: fix MyProfile not having the right data

This commit is contained in:
Jonathan Rainville 2020-07-22 15:41:27 -04:00 committed by Iuri Matias
parent 862dbcba04
commit 145519719b
3 changed files with 16 additions and 5 deletions

View File

@ -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())

View File

@ -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

View File

@ -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 {}