mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Fix activating account more than once.
This commit is contained in:
parent
762589b622
commit
a52bb21606
2 changed files with 11 additions and 4 deletions
Telegram/SourceFiles
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue