fix: allow remove expired api configs (#1907)

This commit is contained in:
vkamn
2025-10-03 14:45:12 +08:00
committed by GitHub
parent 50d1be7b4a
commit e024f71ce1
3 changed files with 10 additions and 6 deletions

View File

@@ -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 serverConfigObject = m_serversModel->getServerConfig(serverIndex);
@@ -543,8 +543,12 @@ bool ApiConfigsController::deactivateDevice()
}
if (isSubscriptionExpired(apiConfigObject)) {
emit errorOccurred(ErrorCode::ApiSubscriptionExpiredError);
return false;
if (isRemoveEvent) {
return true;
} else {
emit errorOccurred(ErrorCode::ApiSubscriptionExpiredError);
return false;
}
}
GatewayRequestData gatewayRequestData { QSysInfo::productType(),