mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
feat: renewal new status logic (#2409)
* fix: renewal add status logic * fix: wakeup activity resumed android
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user