fix: ui fixes for renewal subscription (#2406)

This commit is contained in:
NickVs2015
2026-03-25 07:34:42 +03:00
committed by GitHub
parent f0f0f7c5be
commit 9a0222aee3
8 changed files with 193 additions and 37 deletions
@@ -19,6 +19,15 @@ ListViewType {
id: root
property int selectedIndex: ServersModel.defaultIndex
property int expiredServerIndex: -1
property bool expiringSoon: false
Connections {
target: ApiAccountInfoModel
function onModelReset() {
root.expiringSoon = ApiAccountInfoModel.data("isSubscriptionExpiringSoon")
}
}
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
@@ -35,6 +44,13 @@ ListViewType {
}
}
Connections {
target: ApiConfigsController
function onSubscriptionExpiredOnServer() {
root.expiredServerIndex = ServersModel.defaultIndex
}
}
delegate: Item {
id: menuContentDelegate
objectName: "menuContentDelegate"
@@ -126,6 +142,18 @@ ListViewType {
}
}
CaptionTextType {
visible: isServerFromGatewayApi && (index === root.expiredServerIndex || (root.expiringSoon && index === root.selectedIndex && index !== root.expiredServerIndex))
Layout.fillWidth: true
Layout.leftMargin: 64
Layout.bottomMargin: 8
text: index === root.expiredServerIndex ? qsTr("Subscription expired. Please renew.") : qsTr("Subscription expiring soon.")
color: index === root.expiredServerIndex ? AmneziaStyle.color.vibrantRed : AmneziaStyle.color.goldenApricot
wrapMode: Text.WordWrap
}
DividerType {
Layout.fillWidth: true
Layout.leftMargin: 0