fix(@desktop/profile): Custom picture is not applied everywhere in the app without restart

fixes #4099
This commit is contained in:
Khushboo Mehta 2021-11-16 16:08:06 +01:00 committed by Jakub
parent 7c7b2eb34b
commit 7ee7ba5ebe
2 changed files with 10 additions and 3 deletions

View File

@ -29,6 +29,9 @@ QtObject:
self.address = address
self.identicon = identicon
self.pubKey = pubKey
proc getIdenticon*(self: UserProfile): string {.slot.} =
self.identicon
proc getUsername*(self: UserProfile): string {.slot.} =
self.username

View File

@ -43,7 +43,7 @@ method getProfile*[T](self: Controller[T]): item.Item =
id: singletonInstance.userProfile.getPubKey(),
alias: "",
username: singletonInstance.userProfile.getUsername(),
identicon: singletonInstance.userProfile.getThumbnailImage(),
identicon: singletonInstance.userProfile.getIdenticon(),
address: singletonInstance.userProfile.getAddress(),
ensName: singletonInstance.userProfile.getEnsName(),
ensVerified: false,
@ -61,7 +61,11 @@ method getProfile*[T](self: Controller[T]): item.Item =
return item
method storeIdentityImage*[T](self: Controller[T], address: string, image: string, aX: int, aY: int, bX: int, bY: int): identity_image.IdentityImage =
self.profileService.storeIdentityImage(address, image, aX, aY, bX, bY)
result = self.profileService.storeIdentityImage(address, image, aX, aY, bX, bY)
singletonInstance.userProfile.setThumbnailImage(result.thumbnail)
singletonInstance.userProfile.setLargeImage(result.large)
method deleteIdentityImage*[T](self: Controller[T], address: string): string =
self.profileService.deleteIdentityImage(address)
result = self.profileService.deleteIdentityImage(address)
singletonInstance.userProfile.setThumbnailImage("")
singletonInstance.userProfile.setLargeImage("")