From 44b7feb3c0f9b2613cb5404d660c10e471b40d9b Mon Sep 17 00:00:00 2001 From: SuperDooper <37051355+superdooper86@users.noreply.github.com> Date: Fri, 8 May 2026 21:32:19 +0200 Subject: [PATCH] fix: show extra usage credits from extra_usage fallback; preserve on refresh --- windows/UsageViewModel.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/windows/UsageViewModel.cs b/windows/UsageViewModel.cs index 2847622..87bcade 100644 --- a/windows/UsageViewModel.cs +++ b/windows/UsageViewModel.cs @@ -147,7 +147,15 @@ public class UsageViewModel : INotifyPropertyChanged await Application.Current.Dispatcher.InvokeAsync(() => { - if (limits.Count > 0) { Limits = limits; Overage = overage; Prepaid = prepaid; ExtraUsage = extraUsage; } + if (limits.Count > 0) + { + Limits = limits; + Overage = overage; + Prepaid = prepaid; + // Only clear ExtraUsage if the API explicitly disables it; keep cached value + // if the HTTP endpoint omits the field (it often does for non-browser clients) + if (extraUsage != null) ExtraUsage = extraUsage; + } if (!string.IsNullOrEmpty(planLabel)) PlanLabel = planLabel; if (!string.IsNullOrEmpty(email)) UserEmail = email; IsSignedIn = true;