chore: minor ui fixes

This commit is contained in:
vladimir.kuznetsov 2025-02-22 14:42:09 +07:00
parent 6a424e9858
commit d19017f87b
16 changed files with 90 additions and 29 deletions

View file

@ -1,5 +1,8 @@
#include "apiSettingsController.h"
#include <QEventLoop>
#include <QTimer>
#include "core/api/apiUtils.h"
#include "core/controllers/gatewayController.h"
@ -35,8 +38,14 @@ ApiSettingsController::~ApiSettingsController()
{
}
bool ApiSettingsController::getAccountInfo()
bool ApiSettingsController::getAccountInfo(bool reload)
{
if (reload) {
QEventLoop wait;
QTimer::singleShot(1000, &wait, &QEventLoop::quit);
wait.exec();
}
GatewayController gatewayController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv(), requestTimeoutMsecs);
auto processedIndex = m_serversModel->getProcessedServerIndex();
@ -62,6 +71,10 @@ bool ApiSettingsController::getAccountInfo()
QJsonObject accountInfo = QJsonDocument::fromJson(responseBody).object();
m_apiAccountInfoModel->updateModel(accountInfo, serverConfig);
if (reload) {
updateApiCountryModel();
}
return true;
}