2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Improve self-destruct setting edit.

This commit is contained in:
John Preston
2018-09-17 20:31:01 +03:00
parent 130aa67ba0
commit fe9f02e485
6 changed files with 162 additions and 51 deletions

View File

@@ -380,12 +380,21 @@ void SetupSelfDestruction(not_null<Ui::VerticalLayout*> container) {
AddSkip(container);
AddSubsectionTitle(container, lng_settings_destroy_title);
AddButton(
Auth().api().reloadSelfDestruct();
const auto label = [] {
return Auth().api().selfDestructValue(
) | rpl::map(
SelfDestructionBox::DaysLabel
);
};
AddButtonWithLabel(
container,
lng_settings_self_destruct,
lng_settings_destroy_if,
label(),
st::settingsButton
)->addClickHandler([] {
Ui::show(Box<SelfDestructionBox>());
Ui::show(Box<SelfDestructionBox>(Auth().api().selfDestructValue()));
});
AddSkip(container);