From ccf3468621f5ba6095842a3a7c3345a5eea230a8 Mon Sep 17 00:00:00 2001 From: superdooper86 Date: Thu, 7 May 2026 13:56:31 +0200 Subject: [PATCH] =?UTF-8?q?v2.0.3=20=E2=80=94=20Clean=20up=20extra=20usage?= =?UTF-8?q?=20display,=20remove=20non-existent=20balance=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ClaudeChecker/ContentView.swift | 7 ++----- ClaudeChecker/Info.plist | 4 ++-- ClaudeChecker/Models.swift | 16 +++++----------- README.md | 2 +- version.json | 4 ++-- 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/ClaudeChecker/ContentView.swift b/ClaudeChecker/ContentView.swift index d4d3745..f52dc82 100644 --- a/ClaudeChecker/ContentView.swift +++ b/ClaudeChecker/ContentView.swift @@ -511,11 +511,8 @@ struct ExtraUsageRow: View { .foregroundColor(.secondary) } VStack(spacing: 4) { - ExtraUsageLine(label: "Spent", value: "\(cur) \(fmt(extra.usedCredits))", color: color) - ExtraUsageLine(label: "Limit", value: extra.monthlyLimit != nil ? "\(cur) \(fmt(extra.monthlyLimit))" : "Unlimited", color: .secondary) - if extra.currentBalance != nil { - ExtraUsageLine(label: "Balance", value: "\(cur) \(fmt(extra.currentBalance))", color: .primary) - } + ExtraUsageLine(label: "Spent", value: "\(cur) \(fmt(extra.usedCredits))", color: color) + ExtraUsageLine(label: "Limit", value: extra.monthlyLimit != nil ? "\(cur) \(fmt(extra.monthlyLimit))" : "Unlimited", color: .secondary) } if extra.monthlyLimit != nil { ProgressBar(value: pct / 100, color: color) diff --git a/ClaudeChecker/Info.plist b/ClaudeChecker/Info.plist index 815cac7..432a7c3 100644 --- a/ClaudeChecker/Info.plist +++ b/ClaudeChecker/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.0.2 + 2.0.3 CFBundleVersion - 9 + 10 LSMinimumSystemVersion 13.0 LSUIElement diff --git a/ClaudeChecker/Models.swift b/ClaudeChecker/Models.swift index c1b16ee..cfd381f 100644 --- a/ClaudeChecker/Models.swift +++ b/ClaudeChecker/Models.swift @@ -85,28 +85,22 @@ struct ExtraUsage: Codable { let isEnabled: Bool let monthlyLimit: Double? let usedCredits: Double? - let currentBalance: Double? let utilization: Double? let currency: String? - let resetsAt: String? enum CodingKeys: String, CodingKey { case isEnabled = "is_enabled" case monthlyLimit = "monthly_limit" case usedCredits = "used_credits" - case currentBalance = "current_balance" case utilization case currency - case resetsAt = "resets_at" } init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) - isEnabled = (try? c.decodeIfPresent(Bool.self, forKey: .isEnabled)) ?? false - monthlyLimit = try? c.decodeIfPresent(Double.self, forKey: .monthlyLimit) - usedCredits = try? c.decodeIfPresent(Double.self, forKey: .usedCredits) - currentBalance = try? c.decodeIfPresent(Double.self, forKey: .currentBalance) - utilization = try? c.decodeIfPresent(Double.self, forKey: .utilization) - currency = try? c.decodeIfPresent(String.self, forKey: .currency) - resetsAt = try? c.decodeIfPresent(String.self, forKey: .resetsAt) + isEnabled = (try? c.decodeIfPresent(Bool.self, forKey: .isEnabled)) ?? false + monthlyLimit = try? c.decodeIfPresent(Double.self, forKey: .monthlyLimit) + usedCredits = try? c.decodeIfPresent(Double.self, forKey: .usedCredits) + utilization = try? c.decodeIfPresent(Double.self, forKey: .utilization) + currency = try? c.decodeIfPresent(String.self, forKey: .currency) } } diff --git a/README.md b/README.md index 7dc070b..ffc9434 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![macOS](https://img.shields.io/badge/macOS-13.0+-000000?style=flat&logo=apple&logoColor=white)](https://www.apple.com/macos/) [![Swift](https://img.shields.io/badge/Swift-5.9-F05138?style=flat&logo=swift&logoColor=white)](https://swift.org) -[![Version](https://img.shields.io/badge/version-2.0.2-orange?style=flat)](https://github.com/superdooper86/claudechecker/releases) +[![Version](https://img.shields.io/badge/version-2.0.3-orange?style=flat)](https://github.com/superdooper86/claudechecker/releases) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat)](LICENSE) diff --git a/version.json b/version.json index 173a6e0..47a6075 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "2.0.2", - "url": "https://github.com/superdooper86/claudechecker/releases/download/v2.0.2/ClaudeChecker.zip", + "version": "2.0.3", + "url": "https://github.com/superdooper86/claudechecker/releases/download/v2.0.3/ClaudeChecker.zip", "notes": "Fixed extra usage section." }