Fix photo changing in settings / groups / channels.

This commit is contained in:
John Preston 2022-03-27 18:55:45 +04:00
parent 49d090bb4c
commit 1bd4595bba

View file

@ -240,7 +240,7 @@ void UserpicButton::prepare() {
} }
setClickHandlerByRole(); setClickHandlerByRole();
if (_role == Role::ChangePhoto) { if (_role == Role::ChangePhoto || _role == Role::OpenPhoto) {
chosenImages( chosenImages(
) | rpl::start_with_next([=](QImage &&image) { ) | rpl::start_with_next([=](QImage &&image) {
setImage(std::move(image)); setImage(std::move(image));
@ -262,9 +262,7 @@ void UserpicButton::setClickHandlerByRole() {
break; break;
case Role::OpenPhoto: case Role::OpenPhoto:
addClickHandler([=] { addClickHandler([=] { openPeerPhoto(); });
openPeerPhoto();
});
break; break;
case Role::OpenProfile: case Role::OpenProfile: