mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Retry initial sync on generic network errors (#422)
This commit is contained in:
parent
28dda237c2
commit
27fed83083
2 changed files with 9 additions and 0 deletions
|
@ -1169,6 +1169,12 @@ ChatPage::initialSyncHandler(const mtx::responses::Sync &res, mtx::http::Request
|
||||||
|
|
||||||
nhlog::net()->error("initial sync error: {} {}", status_code, err_code);
|
nhlog::net()->error("initial sync error: {} {}", status_code, err_code);
|
||||||
|
|
||||||
|
// non http related errors
|
||||||
|
if (status_code <= 0 || status_code >= 600) {
|
||||||
|
startInitialSync();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (status_code) {
|
switch (status_code) {
|
||||||
case 502:
|
case 502:
|
||||||
case 504:
|
case 504:
|
||||||
|
|
|
@ -105,6 +105,9 @@ private slots:
|
||||||
//! Show the login page in the main window.
|
//! Show the login page in the main window.
|
||||||
void showLoginPage()
|
void showLoginPage()
|
||||||
{
|
{
|
||||||
|
if (modal_)
|
||||||
|
modal_->hide();
|
||||||
|
|
||||||
pageStack_->addWidget(login_page_);
|
pageStack_->addWidget(login_page_);
|
||||||
pageStack_->setCurrentWidget(login_page_);
|
pageStack_->setCurrentWidget(login_page_);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue