v2.0.3 — Clean up extra usage display, remove non-existent balance field
This commit is contained in:
@@ -511,11 +511,8 @@ struct ExtraUsageRow: View {
|
|||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
VStack(spacing: 4) {
|
VStack(spacing: 4) {
|
||||||
ExtraUsageLine(label: "Spent", value: "\(cur) \(fmt(extra.usedCredits))", color: color)
|
ExtraUsageLine(label: "Spent", value: "\(cur) \(fmt(extra.usedCredits))", color: color)
|
||||||
ExtraUsageLine(label: "Limit", value: extra.monthlyLimit != nil ? "\(cur) \(fmt(extra.monthlyLimit))" : "Unlimited", color: .secondary)
|
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if extra.monthlyLimit != nil {
|
if extra.monthlyLimit != nil {
|
||||||
ProgressBar(value: pct / 100, color: color)
|
ProgressBar(value: pct / 100, color: color)
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.0.2</string>
|
<string>2.0.3</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>9</string>
|
<string>10</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>13.0</string>
|
<string>13.0</string>
|
||||||
<key>LSUIElement</key>
|
<key>LSUIElement</key>
|
||||||
|
|||||||
@@ -85,28 +85,22 @@ struct ExtraUsage: Codable {
|
|||||||
let isEnabled: Bool
|
let isEnabled: Bool
|
||||||
let monthlyLimit: Double?
|
let monthlyLimit: Double?
|
||||||
let usedCredits: Double?
|
let usedCredits: Double?
|
||||||
let currentBalance: Double?
|
|
||||||
let utilization: Double?
|
let utilization: Double?
|
||||||
let currency: String?
|
let currency: String?
|
||||||
let resetsAt: String?
|
|
||||||
enum CodingKeys: String, CodingKey {
|
enum CodingKeys: String, CodingKey {
|
||||||
case isEnabled = "is_enabled"
|
case isEnabled = "is_enabled"
|
||||||
case monthlyLimit = "monthly_limit"
|
case monthlyLimit = "monthly_limit"
|
||||||
case usedCredits = "used_credits"
|
case usedCredits = "used_credits"
|
||||||
case currentBalance = "current_balance"
|
|
||||||
case utilization
|
case utilization
|
||||||
case currency
|
case currency
|
||||||
case resetsAt = "resets_at"
|
|
||||||
}
|
}
|
||||||
init(from decoder: Decoder) throws {
|
init(from decoder: Decoder) throws {
|
||||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
isEnabled = (try? c.decodeIfPresent(Bool.self, forKey: .isEnabled)) ?? false
|
isEnabled = (try? c.decodeIfPresent(Bool.self, forKey: .isEnabled)) ?? false
|
||||||
monthlyLimit = try? c.decodeIfPresent(Double.self, forKey: .monthlyLimit)
|
monthlyLimit = try? c.decodeIfPresent(Double.self, forKey: .monthlyLimit)
|
||||||
usedCredits = try? c.decodeIfPresent(Double.self, forKey: .usedCredits)
|
usedCredits = try? c.decodeIfPresent(Double.self, forKey: .usedCredits)
|
||||||
currentBalance = try? c.decodeIfPresent(Double.self, forKey: .currentBalance)
|
utilization = try? c.decodeIfPresent(Double.self, forKey: .utilization)
|
||||||
utilization = try? c.decodeIfPresent(Double.self, forKey: .utilization)
|
currency = try? c.decodeIfPresent(String.self, forKey: .currency)
|
||||||
currency = try? c.decodeIfPresent(String.self, forKey: .currency)
|
|
||||||
resetsAt = try? c.decodeIfPresent(String.self, forKey: .resetsAt)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
[](https://www.apple.com/macos/)
|
[](https://www.apple.com/macos/)
|
||||||
[](https://swift.org)
|
[](https://swift.org)
|
||||||
[](https://github.com/superdooper86/claudechecker/releases)
|
[](https://github.com/superdooper86/claudechecker/releases)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"url": "https://github.com/superdooper86/claudechecker/releases/download/v2.0.2/ClaudeChecker.zip",
|
"url": "https://github.com/superdooper86/claudechecker/releases/download/v2.0.3/ClaudeChecker.zip",
|
||||||
"notes": "Fixed extra usage section."
|
"notes": "Fixed extra usage section."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user