mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Move _authSession to Main::Account.
This commit is contained in:
@@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "window/window_lock_widgets.h"
|
||||
#include "window/window_outdated_bar.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "main/main_account.h" // Account::authSessionValue.
|
||||
#include "core/click_handler_types.h"
|
||||
#include "core/application.h"
|
||||
#include "core/sandbox.h"
|
||||
@@ -125,11 +126,14 @@ MainWindow::MainWindow()
|
||||
subscribe(Global::RefWorkMode(), [=](DBIWorkMode mode) {
|
||||
workmodeUpdated(mode);
|
||||
});
|
||||
subscribe(Core::App().authSessionChanged(), [=] {
|
||||
checkAuthSession();
|
||||
|
||||
Core::App().activeAccount().sessionValue(
|
||||
) | rpl::start_with_next([=](AuthSession *session) {
|
||||
_controller = session
|
||||
? std::make_unique<Window::Controller>(session, this)
|
||||
: nullptr;
|
||||
updateWindowIcon();
|
||||
});
|
||||
checkAuthSession();
|
||||
}, lifetime());
|
||||
|
||||
Core::App().termsLockValue(
|
||||
) | rpl::start_with_next([=] {
|
||||
@@ -639,14 +643,6 @@ void MainWindow::launchDrag(std::unique_ptr<QMimeData> data) {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::checkAuthSession() {
|
||||
if (AuthSession::Exists()) {
|
||||
_controller = std::make_unique<Window::Controller>(&Auth(), this);
|
||||
} else {
|
||||
_controller = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setInactivePress(bool inactive) {
|
||||
_wasInactivePress = inactive;
|
||||
if (_wasInactivePress) {
|
||||
|
Reference in New Issue
Block a user