From 77c6db2155f10fa862dcb5d8048a33deb9b136b5 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 26 Jul 2017 14:26:46 +0200 Subject: [PATCH] Fix refresh avatar image after change it --- retroshare-qml-app/src/ChatCache.qml | 8 ++++++++ retroshare-qml-app/src/ContactDetails.qml | 2 +- retroshare-qml-app/src/components/AvatarOrColorHash.qml | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/ChatCache.qml b/retroshare-qml-app/src/ChatCache.qml index 6e7b55c72..90865ac4a 100644 --- a/retroshare-qml-app/src/ChatCache.qml +++ b/retroshare-qml-app/src/ChatCache.qml @@ -133,6 +133,14 @@ QtObject } return "" } + function delIdentityAvatar (gxsId) + { + if (identityDetails[gxsId] && identityDetails[gxsId].avatar !== undefined) + { + identityDetails[gxsId].avatar = "" + } + + } } diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index f3e220e36..c05bb596f 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -65,7 +65,7 @@ Item if (jP.returncode === "ok") { console.log("Avatar changed! ") - topFace.getDetails() + topFace.refresh() } }) } diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 77c7e90ef..0db2c5675 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -105,6 +105,13 @@ Item } } + function refresh() + { + ChatCache.contactsCache.delIdentityAvatar(gxs_id) + compRoot.avatarAttemptCnt = 0 + getDetails() + + } Component.onCompleted: startComponent ()