Avoid stale state for chat page picture
This commit is contained in:
parent
e4dbb63a92
commit
baf4b27e60
1 changed files with 10 additions and 1 deletions
|
@ -595,12 +595,21 @@ Page {
|
||||||
|
|
||||||
ProfileThumbnail {
|
ProfileThumbnail {
|
||||||
id: chatPictureThumbnail
|
id: chatPictureThumbnail
|
||||||
photoData: chatModel.smallPhoto
|
|
||||||
replacementStringHint: chatNameText.text
|
replacementStringHint: chatNameText.text
|
||||||
width: chatOverviewColumn.height
|
width: chatOverviewColumn.height
|
||||||
height: chatOverviewColumn.height
|
height: chatOverviewColumn.height
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: chatPage.isPortrait ? Theme.paddingMedium : Theme.paddingSmall
|
anchors.bottomMargin: chatPage.isPortrait ? Theme.paddingMedium : Theme.paddingSmall
|
||||||
|
|
||||||
|
// Setting it directly may cause an stale state for the thumbnail in case the chat page
|
||||||
|
// was previously loaded with a picture and now it doesn't have one. Instead setting it
|
||||||
|
// when the ChatModel indicates a change. This also avoids flickering when the page is loaded...
|
||||||
|
Connections {
|
||||||
|
target: chatModel
|
||||||
|
onSmallPhotoChanged: {
|
||||||
|
chatPictureThumbnail.photoData = chatModel.smallPhoto;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
Loading…
Reference in a new issue