feat: renewal new status logic (#2409)

* fix: renewal add status logic

* fix: wakeup activity resumed android
This commit is contained in:
NickVs2015
2026-03-25 14:48:32 +03:00
committed by GitHub
parent 9a0222aee3
commit bf3d11e5c4
12 changed files with 61 additions and 56 deletions
+1 -11
View File
@@ -78,7 +78,6 @@ QVariant ApiAccountInfoModel::data(const QModelIndex &index, int role) const
}
case IsSubscriptionExpiredRole: {
if (m_accountInfoData.configType == apiDefs::ConfigType::AmneziaFreeV3) return false;
if (m_isSubscriptionExpiredByServer) return true;
if (m_accountInfoData.subscriptionEndDate.isEmpty()) return false;
return apiUtils::isSubscriptionExpired(m_accountInfoData.subscriptionEndDate);
}
@@ -87,7 +86,7 @@ QVariant ApiAccountInfoModel::data(const QModelIndex &index, int role) const
if (m_accountInfoData.subscriptionEndDate.isEmpty()) return false;
if (apiUtils::isSubscriptionExpired(m_accountInfoData.subscriptionEndDate)) return false;
QDateTime endDate = QDateTime::fromString(m_accountInfoData.subscriptionEndDate, Qt::ISODateWithMs);
return endDate <= QDateTime::currentDateTimeUtc().addDays(30);
return endDate <= QDateTime::currentDateTimeUtc().addDays(10);
}
}
@@ -98,8 +97,6 @@ void ApiAccountInfoModel::updateModel(const QJsonObject &accountInfoObject, cons
{
beginResetModel();
m_isSubscriptionExpiredByServer = false;
AccountInfoData accountInfoData;
m_availableCountries = accountInfoObject.value(apiDefs::key::availableCountries).toArray();
@@ -124,13 +121,6 @@ void ApiAccountInfoModel::updateModel(const QJsonObject &accountInfoObject, cons
endResetModel();
}
void ApiAccountInfoModel::setSubscriptionExpiredByServer()
{
beginResetModel();
m_isSubscriptionExpiredByServer = true;
endResetModel();
}
QVariant ApiAccountInfoModel::data(const QString &roleString)
{
QModelIndex modelIndex = index(0);