fix: refactor a bit

This commit is contained in:
ZavaruKitsu
2023-07-02 15:36:03 +03:00
parent f12dc74cd1
commit b6b3ad5ff9
13 changed files with 62 additions and 28 deletions
+2 -3
View File
@@ -92,8 +92,7 @@ void Tray::rebuildMenu() {
auto turnGhostModeText = _textUpdates.events(
) | rpl::map([=] {
auto settings = &AyuSettings::getInstance();
bool ghostModeEnabled = settings->get_ghostModeEnabled();
bool ghostModeEnabled = AyuSettings::get_ghostModeEnabled();
return ghostModeEnabled
? tr::ayu_DisableGhostMode(tr::now)
@@ -102,7 +101,7 @@ void Tray::rebuildMenu() {
_tray.addAction(std::move(turnGhostModeText), [=] {
auto settings = &AyuSettings::getInstance();
bool ghostMode = !settings->get_ghostModeEnabled();
bool ghostMode = !AyuSettings::get_ghostModeEnabled();
settings->set_sendReadPackets(!ghostMode);
settings->set_sendOnlinePackets(!ghostMode);