Fix activating account more than once.

This commit is contained in:
John Preston 2023-02-03 09:59:28 +04:00
parent 762589b622
commit a52bb21606
2 changed files with 11 additions and 4 deletions

View File

@ -442,6 +442,9 @@ void Domain::maybeActivate(not_null<Main::Account*> account) {
}
void Domain::activate(not_null<Main::Account*> account) {
if (const auto window = Core::App().separateWindowForAccount(account)) {
window->activate();
}
if (_active.current() == account.get()) {
return;
}

View File

@ -897,10 +897,14 @@ void AccountsList::rebuild() {
Core::App().domain().maybeActivate(account);
}
};
base::call_delayed(
st::defaultRippleAnimation.hideDuration,
account,
std::move(activate));
if (Core::App().separateWindowForAccount(account)) {
activate();
} else {
base::call_delayed(
st::defaultRippleAnimation.hideDuration,
account,
std::move(activate));
}
};
button.reset(inner->add(MakeAccountButton(
inner,