mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Added initial support for increased premium count of accounts.
This commit is contained in:
@@ -326,7 +326,7 @@ void FillMenu(
|
||||
&st::menuIconCancel);
|
||||
} else {
|
||||
const auto &list = Core::App().domain().accounts();
|
||||
if (list.size() < ::Main::Domain::kMaxAccounts) {
|
||||
if (list.size() < Core::App().domain().maxAccounts()) {
|
||||
addAction(tr::lng_menu_add_account(tr::now), [=] {
|
||||
Core::App().domain().addActivated(MTP::Environment{});
|
||||
}, &st::menuIconAddAccount);
|
||||
|
@@ -708,7 +708,13 @@ not_null<Ui::SlideWrap<Ui::SettingsButton>*> AccountsList::setupAdd() {
|
||||
|
||||
const auto add = [=](MTP::Environment environment) {
|
||||
Core::App().preventOrInvoke([=] {
|
||||
Core::App().domain().addActivated(environment);
|
||||
auto &domain = _controller->session().domain();
|
||||
if (domain.accounts().size() >= domain.maxAccounts()) {
|
||||
_controller->show(
|
||||
Box(AccountsLimitBox, &_controller->session()));
|
||||
} else {
|
||||
domain.addActivated(environment);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -804,7 +810,7 @@ void AccountsList::rebuild() {
|
||||
inner->resizeToWidth(_outer->width());
|
||||
|
||||
_addAccount->toggle(
|
||||
(inner->count() < Main::Domain::kMaxAccounts),
|
||||
(inner->count() < Main::Domain::kPremiumMaxAccounts),
|
||||
anim::type::instant);
|
||||
|
||||
_reorder->start();
|
||||
|
Reference in New Issue
Block a user