Use the right method to save external video player option state (#265)

This commit is contained in:
ilya-fedin 2021-12-09 10:06:57 +04:00 • committed by GitHub
parent 39b3217dd3
commit 5778c68526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -714,7 +714,9 @@ void SetupKotatoSystem(
AddSkip(container); AddSkip(container);
} }
void SetupKotatoOther(not_null<Ui::VerticalLayout*> container) { void SetupKotatoOther(
not_null<Window::SessionController*> controller,
not_null<Ui::VerticalLayout*> container) {
AddDivider(container); AddDivider(container);
AddSkip(container); AddSkip(container);
AddSubsectionTitle(container, rktr("ktg_settings_other")); AddSubsectionTitle(container, rktr("ktg_settings_other"));
@ -768,9 +770,9 @@ void SetupKotatoOther(not_null<Ui::VerticalLayout*> container) {
)->toggledValue( )->toggledValue(
) | rpl::filter([](bool enabled) { ) | rpl::filter([](bool enabled) {
return (enabled != cUseExternalVideoPlayer()); return (enabled != cUseExternalVideoPlayer());
}) | rpl::start_with_next([](bool enabled) { }) | rpl::start_with_next([=](bool enabled) {
cSetUseExternalVideoPlayer(enabled); cSetUseExternalVideoPlayer(enabled);
Core::App().saveSettingsDelayed(); controller->session().saveSettingsDelayed();
}, container->lifetime()); }, container->lifetime());
AddSkip(container); AddSkip(container);
@ -793,7 +795,7 @@ void Kotato::setupContent(not_null<Window::SessionController*> controller) {
SetupKotatoNetwork(content); SetupKotatoNetwork(content);
SetupKotatoFolders(controller, content); SetupKotatoFolders(controller, content);
SetupKotatoSystem(controller, content); SetupKotatoSystem(controller, content);
SetupKotatoOther(content); SetupKotatoOther(controller, content);
Ui::ResizeFitChild(this, content); Ui::ResizeFitChild(this, content);
} }