mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
chore: minor fixes (#2477)
This commit is contained in:
@@ -91,6 +91,12 @@ QVariant ApiServicesModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case IsPremiumRole: {
|
||||
return serviceType == serviceType::amneziaPremium;
|
||||
}
|
||||
case HasSubscriptionPlansRole: {
|
||||
return !apiServiceData.subscriptionPlansJson.isEmpty();
|
||||
}
|
||||
case PriceRole: {
|
||||
return apiServiceData.minPriceLabel;
|
||||
}
|
||||
@@ -233,6 +239,8 @@ QHash<int, QByteArray> ApiServicesModel::roleNames() const
|
||||
roles[CardDescriptionRole] = "cardDescription";
|
||||
roles[ServiceDescriptionRole] = "serviceDescription";
|
||||
roles[IsServiceAvailableRole] = "isServiceAvailable";
|
||||
roles[IsPremiumRole] = "isPremium";
|
||||
roles[HasSubscriptionPlansRole] = "hasSubscriptionPlans";
|
||||
roles[PriceRole] = "price";
|
||||
roles[EndDateRole] = "endDate";
|
||||
roles[TermsOfUseUrlRole] = "termsOfUseUrl";
|
||||
|
||||
@@ -54,6 +54,8 @@ public:
|
||||
CardDescriptionRole,
|
||||
ServiceDescriptionRole,
|
||||
IsServiceAvailableRole,
|
||||
IsPremiumRole,
|
||||
HasSubscriptionPlansRole,
|
||||
PriceRole,
|
||||
EndDateRole,
|
||||
TermsOfUseUrlRole,
|
||||
|
||||
@@ -67,8 +67,11 @@ PageType {
|
||||
}
|
||||
|
||||
delegate: ColumnLayout {
|
||||
property bool hideCard: isPremium && !hasSubscriptionPlans
|
||||
|
||||
width: listView.width
|
||||
visible: !hideCard
|
||||
height: hideCard ? 0 : implicitHeight
|
||||
|
||||
enabled: isServiceAvailable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user