bugfix: fixed sending requests if there are no premium v1 keys in the application (#1599)
This commit is contained in:
parent
a3e73797c2
commit
a6508e642a
1 changed files with 12 additions and 10 deletions
|
@ -29,18 +29,20 @@ bool ApiPremV1MigrationController::hasConfigsToMigration()
|
||||||
vpnKeys.append(vpnKey);
|
vpnKeys.append(vpnKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
GatewayController gatewayController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
|
if (!vpnKeys.isEmpty()) {
|
||||||
m_settings->isStrictKillSwitchEnabled());
|
GatewayController gatewayController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
|
||||||
QJsonObject apiPayload;
|
m_settings->isStrictKillSwitchEnabled());
|
||||||
|
QJsonObject apiPayload;
|
||||||
|
|
||||||
apiPayload["configs"] = vpnKeys;
|
apiPayload["configs"] = vpnKeys;
|
||||||
QByteArray responseBody;
|
QByteArray responseBody;
|
||||||
ErrorCode errorCode = gatewayController.post(QString("%1v1/prem-v1/is-active-subscription"), apiPayload, responseBody);
|
ErrorCode errorCode = gatewayController.post(QString("%1v1/prem-v1/is-active-subscription"), apiPayload, responseBody);
|
||||||
|
|
||||||
auto migrationsStatus = QJsonDocument::fromJson(responseBody).object();
|
auto migrationsStatus = QJsonDocument::fromJson(responseBody).object();
|
||||||
for (const auto &migrationStatus : migrationsStatus) {
|
for (const auto &migrationStatus : migrationsStatus) {
|
||||||
if (migrationStatus == "not_found") {
|
if (migrationStatus == "not_found") {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue