fix: tray and serialization

This commit is contained in:
ZavaruKitsu 2023-11-10 18:31:59 +03:00
parent ae3dfacdf9
commit 95f18f2120
3 changed files with 17 additions and 30 deletions

View file

@ -221,6 +221,7 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
localPremium,
copyUsernameAsLink,
appIcon,
simpleQuotesAndReplies,
deletedMark,
editedMark,
recentStickersCount,

View file

@ -805,22 +805,6 @@ void Ayu::SetupCustomization(not_null<Ui::VerticalLayout *> container,
AyuSettings::save();
}, container->lifetime());
AddButton(
container,
tr::ayu_ShowGhostToggleInDrawer(),
st::settingsButtonNoIcon
)->toggleOn(
rpl::single(settings->showGhostToggleInDrawer)
)->toggledValue(
) | rpl::filter([=](bool enabled)
{
return (enabled != settings->showGhostToggleInDrawer);
}) | start_with_next([=](bool enabled)
{
settings->set_showGhostToggleInDrawer(enabled);
AyuSettings::save();
}, container->lifetime());
AddButton(
container,
tr::ayu_SettingsShowMessageSeconds(),

View file

@ -102,6 +102,7 @@ void Tray::rebuildMenu() {
auto settings = &AyuSettings::getInstance();
if (settings->showGhostToggleInTray) {
auto turnGhostModeText = _textUpdates.events(
) | rpl::map([=]
{
@ -119,6 +120,7 @@ void Tray::rebuildMenu() {
AyuSettings::save();
});
}
if (settings->showStreamerToggleInTray) {
auto turnStreamerModeText = _textUpdates.events(