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;
|
return true;
|
||||||
}
|
}
|
||||||
|
case IsPremiumRole: {
|
||||||
|
return serviceType == serviceType::amneziaPremium;
|
||||||
|
}
|
||||||
|
case HasSubscriptionPlansRole: {
|
||||||
|
return !apiServiceData.subscriptionPlansJson.isEmpty();
|
||||||
|
}
|
||||||
case PriceRole: {
|
case PriceRole: {
|
||||||
return apiServiceData.minPriceLabel;
|
return apiServiceData.minPriceLabel;
|
||||||
}
|
}
|
||||||
@@ -233,6 +239,8 @@ QHash<int, QByteArray> ApiServicesModel::roleNames() const
|
|||||||
roles[CardDescriptionRole] = "cardDescription";
|
roles[CardDescriptionRole] = "cardDescription";
|
||||||
roles[ServiceDescriptionRole] = "serviceDescription";
|
roles[ServiceDescriptionRole] = "serviceDescription";
|
||||||
roles[IsServiceAvailableRole] = "isServiceAvailable";
|
roles[IsServiceAvailableRole] = "isServiceAvailable";
|
||||||
|
roles[IsPremiumRole] = "isPremium";
|
||||||
|
roles[HasSubscriptionPlansRole] = "hasSubscriptionPlans";
|
||||||
roles[PriceRole] = "price";
|
roles[PriceRole] = "price";
|
||||||
roles[EndDateRole] = "endDate";
|
roles[EndDateRole] = "endDate";
|
||||||
roles[TermsOfUseUrlRole] = "termsOfUseUrl";
|
roles[TermsOfUseUrlRole] = "termsOfUseUrl";
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ public:
|
|||||||
CardDescriptionRole,
|
CardDescriptionRole,
|
||||||
ServiceDescriptionRole,
|
ServiceDescriptionRole,
|
||||||
IsServiceAvailableRole,
|
IsServiceAvailableRole,
|
||||||
|
IsPremiumRole,
|
||||||
|
HasSubscriptionPlansRole,
|
||||||
PriceRole,
|
PriceRole,
|
||||||
EndDateRole,
|
EndDateRole,
|
||||||
TermsOfUseUrlRole,
|
TermsOfUseUrlRole,
|
||||||
|
|||||||
@@ -67,8 +67,11 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
delegate: ColumnLayout {
|
delegate: ColumnLayout {
|
||||||
|
property bool hideCard: isPremium && !hasSubscriptionPlans
|
||||||
|
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
visible: !hideCard
|
||||||
|
height: hideCard ? 0 : implicitHeight
|
||||||
|
|
||||||
enabled: isServiceAvailable
|
enabled: isServiceAvailable
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user