ui: do not show subscription percentage when there are no conections and no session (#6066)

* ui: do not show subscription percentage when there are no conections and no session

* show % sign when share is not known yet
This commit is contained in:
Evgeny
2025-07-14 11:02:19 +01:00
committed by GitHub
parent dd3943d994
commit ca672bbc77
2 changed files with 23 additions and 27 deletions
@@ -120,7 +120,7 @@ fun SubscriptionStatusIndicatorView(subs: SMPServerSubs, hasSess: Boolean, leadi
val netCfg = rememberUpdatedState(chatModel.controller.getNetCfg())
val statusColorAndPercentage = subscriptionStatusColorAndPercentage(chatModel.networkInfo.value.online, netCfg.value.socksProxy, subs, hasSess)
val pref = remember { chatModel.controller.appPrefs.networkShowSubscriptionPercentage }
val percentageText = "${(floor(statusColorAndPercentage.statusPercent * 100)).toInt()}%"
val percentageText = if (subs.total > 0 || hasSess) "${(floor(statusColorAndPercentage.statusPercent * 100)).toInt()}%" else "%"
Row(
verticalAlignment = Alignment.CenterVertically,