2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Allow not type-erased producers.

This commit is contained in:
John Preston
2017-09-27 14:16:05 +03:00
parent 086e46c162
commit cdda7f8f9a
25 changed files with 636 additions and 268 deletions

View File

@@ -185,11 +185,12 @@ SectionWithToggle *SectionWithToggle::setToggleShown(
}
rpl::producer<bool> SectionWithToggle::toggledValue() const {
return _toggle
? (rpl::single(_toggle->checked())
if (_toggle) {
return rpl::single(_toggle->checked())
| rpl::then(
base::ObservableViewer(_toggle->checkedChanged)))
: rpl::never<bool>();
base::ObservableViewer(_toggle->checkedChanged));
}
return rpl::never<bool>();
}
rpl::producer<bool> SectionWithToggle::toggleShownValue() const {