fix(@desktop/profile): Custom picture is not applied everywhere in the app without restart
fixes #4099
This commit is contained in:
parent
7c7b2eb34b
commit
7ee7ba5ebe
|
@ -30,6 +30,9 @@ QtObject:
|
||||||
self.identicon = identicon
|
self.identicon = identicon
|
||||||
self.pubKey = pubKey
|
self.pubKey = pubKey
|
||||||
|
|
||||||
|
proc getIdenticon*(self: UserProfile): string {.slot.} =
|
||||||
|
self.identicon
|
||||||
|
|
||||||
proc getUsername*(self: UserProfile): string {.slot.} =
|
proc getUsername*(self: UserProfile): string {.slot.} =
|
||||||
self.username
|
self.username
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ method getProfile*[T](self: Controller[T]): item.Item =
|
||||||
id: singletonInstance.userProfile.getPubKey(),
|
id: singletonInstance.userProfile.getPubKey(),
|
||||||
alias: "",
|
alias: "",
|
||||||
username: singletonInstance.userProfile.getUsername(),
|
username: singletonInstance.userProfile.getUsername(),
|
||||||
identicon: singletonInstance.userProfile.getThumbnailImage(),
|
identicon: singletonInstance.userProfile.getIdenticon(),
|
||||||
address: singletonInstance.userProfile.getAddress(),
|
address: singletonInstance.userProfile.getAddress(),
|
||||||
ensName: singletonInstance.userProfile.getEnsName(),
|
ensName: singletonInstance.userProfile.getEnsName(),
|
||||||
ensVerified: false,
|
ensVerified: false,
|
||||||
|
@ -61,7 +61,11 @@ method getProfile*[T](self: Controller[T]): item.Item =
|
||||||
return item
|
return item
|
||||||
|
|
||||||
method storeIdentityImage*[T](self: Controller[T], address: string, image: string, aX: int, aY: int, bX: int, bY: int): identity_image.IdentityImage =
|
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 =
|
method deleteIdentityImage*[T](self: Controller[T], address: string): string =
|
||||||
self.profileService.deleteIdentityImage(address)
|
result = self.profileService.deleteIdentityImage(address)
|
||||||
|
singletonInstance.userProfile.setThumbnailImage("")
|
||||||
|
singletonInstance.userProfile.setLargeImage("")
|
||||||
|
|
Loading…
Reference in New Issue