mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Added count of active sessions as label of button in settings.
This commit is contained in:
parent
035a19b41e
commit
163e549708
1 changed files with 10 additions and 1 deletions
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "settings/settings_privacy_security.h"
|
||||
|
||||
#include "api/api_authorizations.h"
|
||||
#include "api/api_self_destruct.h"
|
||||
#include "api/api_sensitive_content.h"
|
||||
#include "api/api_global_privacy.h"
|
||||
|
@ -553,9 +554,17 @@ void SetupSessionsList(
|
|||
AddSkip(container);
|
||||
AddSubsectionTitle(container, tr::lng_settings_sessions_title());
|
||||
|
||||
AddButton(
|
||||
auto &authorizations = controller->session().api().authorizations();
|
||||
authorizations.reload();
|
||||
auto count = authorizations.totalChanges(
|
||||
) | rpl::map([](int count) {
|
||||
return count ? QString::number(count) : QString();
|
||||
});
|
||||
|
||||
AddButtonWithLabel(
|
||||
container,
|
||||
tr::lng_settings_show_sessions(),
|
||||
std::move(count),
|
||||
st::settingsButton
|
||||
)->addClickHandler([=] {
|
||||
Ui::show(Box<SessionsBox>(&controller->session()));
|
||||
|
|
Loading…
Add table
Reference in a new issue