mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Fix idle time checking in MainWidget.
Regression was introduced in 78d00bcf22
.
Fixes #5779, fixes #5780.
This commit is contained in:
@@ -3680,7 +3680,7 @@ void MainWidget::updateOnline(bool gotOtherOffline) {
|
|||||||
bool isOnline = !App::quitting() && App::wnd()->isActive();
|
bool isOnline = !App::quitting() && App::wnd()->isActive();
|
||||||
int updateIn = Global::OnlineUpdatePeriod();
|
int updateIn = Global::OnlineUpdatePeriod();
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
const auto idle = crl::now() - Platform::LastUserInputTime();
|
const auto idle = crl::now() - Core::App().lastNonIdleTime();
|
||||||
if (idle >= Global::OfflineIdleTimeout()) {
|
if (idle >= Global::OfflineIdleTimeout()) {
|
||||||
isOnline = false;
|
isOnline = false;
|
||||||
if (!_isIdle) {
|
if (!_isIdle) {
|
||||||
@@ -3796,7 +3796,8 @@ void MainWidget::writeDrafts(History *history) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::checkIdleFinish() {
|
void MainWidget::checkIdleFinish() {
|
||||||
if (crl::now() - Platform::LastUserInputTime() < Global::OfflineIdleTimeout()) {
|
if (crl::now() - Core::App().lastNonIdleTime()
|
||||||
|
< Global::OfflineIdleTimeout()) {
|
||||||
_idleFinishTimer.cancel();
|
_idleFinishTimer.cancel();
|
||||||
_isIdle = false;
|
_isIdle = false;
|
||||||
updateOnline();
|
updateOnline();
|
||||||
|
Reference in New Issue
Block a user