mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
fix: allow remove expired api configs (#1907)
This commit is contained in:
@@ -532,7 +532,7 @@ bool ApiConfigsController::updateServiceFromTelegram(const int serverIndex)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ApiConfigsController::deactivateDevice()
|
bool ApiConfigsController::deactivateDevice(const bool isRemoveEvent)
|
||||||
{
|
{
|
||||||
auto serverIndex = m_serversModel->getProcessedServerIndex();
|
auto serverIndex = m_serversModel->getProcessedServerIndex();
|
||||||
auto serverConfigObject = m_serversModel->getServerConfig(serverIndex);
|
auto serverConfigObject = m_serversModel->getServerConfig(serverIndex);
|
||||||
@@ -543,8 +543,12 @@ bool ApiConfigsController::deactivateDevice()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isSubscriptionExpired(apiConfigObject)) {
|
if (isSubscriptionExpired(apiConfigObject)) {
|
||||||
emit errorOccurred(ErrorCode::ApiSubscriptionExpiredError);
|
if (isRemoveEvent) {
|
||||||
return false;
|
return true;
|
||||||
|
} else {
|
||||||
|
emit errorOccurred(ErrorCode::ApiSubscriptionExpiredError);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GatewayRequestData gatewayRequestData { QSysInfo::productType(),
|
GatewayRequestData gatewayRequestData { QSysInfo::productType(),
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public slots:
|
|||||||
bool updateServiceFromGateway(const int serverIndex, const QString &newCountryCode, const QString &newCountryName,
|
bool updateServiceFromGateway(const int serverIndex, const QString &newCountryCode, const QString &newCountryName,
|
||||||
bool reloadServiceConfig = false);
|
bool reloadServiceConfig = false);
|
||||||
bool updateServiceFromTelegram(const int serverIndex);
|
bool updateServiceFromTelegram(const int serverIndex);
|
||||||
bool deactivateDevice();
|
bool deactivateDevice(const bool isRemoveEvent);
|
||||||
bool deactivateExternalDevice(const QString &uuid, const QString &serverCountryCode);
|
bool deactivateExternalDevice(const QString &uuid, const QString &serverCountryCode);
|
||||||
|
|
||||||
bool isConfigValid();
|
bool isConfigValid();
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ PageType {
|
|||||||
PageController.showNotificationMessage(qsTr("Cannot unlink device during active connection"))
|
PageController.showNotificationMessage(qsTr("Cannot unlink device during active connection"))
|
||||||
} else {
|
} else {
|
||||||
PageController.showBusyIndicator(true)
|
PageController.showBusyIndicator(true)
|
||||||
if (ApiConfigsController.deactivateDevice()) {
|
if (ApiConfigsController.deactivateDevice(false)) {
|
||||||
ApiSettingsController.getAccountInfo(true)
|
ApiSettingsController.getAccountInfo(true)
|
||||||
}
|
}
|
||||||
PageController.showBusyIndicator(false)
|
PageController.showBusyIndicator(false)
|
||||||
@@ -396,7 +396,7 @@ PageType {
|
|||||||
PageController.showNotificationMessage(qsTr("Cannot remove server during active connection"))
|
PageController.showNotificationMessage(qsTr("Cannot remove server during active connection"))
|
||||||
} else {
|
} else {
|
||||||
PageController.showBusyIndicator(true)
|
PageController.showBusyIndicator(true)
|
||||||
if (ApiConfigsController.deactivateDevice()) {
|
if (ApiConfigsController.deactivateDevice(true)) {
|
||||||
InstallController.removeProcessedServer()
|
InstallController.removeProcessedServer()
|
||||||
}
|
}
|
||||||
PageController.showBusyIndicator(false)
|
PageController.showBusyIndicator(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user