Update Neon colors and show color circles in theme picker
- Update NeonMoodTint to use synthwave colors matching Neon voting style (cyan, lime, yellow, orange, magenta) - Replace text label with 5 color circles in theme preview Colors row - Remove unused textColor customization code and picker views - Add .id(moodTint) to Month/Year views for color refresh - Clean up various unused color-related code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,6 +75,12 @@ class IAPManager: ObservableObject {
|
||||
|
||||
private var updateListenerTask: Task<Void, Error>?
|
||||
|
||||
/// Last time subscription status was checked (for throttling)
|
||||
private var lastStatusCheckTime: Date?
|
||||
|
||||
/// Minimum interval between status checks (5 minutes)
|
||||
private let statusCheckInterval: TimeInterval = 300
|
||||
|
||||
// MARK: - Computed Properties
|
||||
|
||||
var isSubscribed: Bool {
|
||||
@@ -138,9 +144,21 @@ class IAPManager: ObservableObject {
|
||||
// MARK: - Public Methods
|
||||
|
||||
/// Check subscription status - call on app launch and when becoming active
|
||||
/// Throttled to avoid excessive StoreKit calls on rapid foreground transitions
|
||||
func checkSubscriptionStatus() async {
|
||||
isLoading = true
|
||||
defer { isLoading = false }
|
||||
// Throttle: skip if we checked recently (unless state is unknown)
|
||||
if state != .unknown,
|
||||
let lastCheck = lastStatusCheckTime,
|
||||
Date().timeIntervalSince(lastCheck) < statusCheckInterval {
|
||||
return
|
||||
}
|
||||
|
||||
// Only update isLoading if value actually changes to avoid unnecessary view updates
|
||||
if !isLoading { isLoading = true }
|
||||
defer {
|
||||
if isLoading { isLoading = false }
|
||||
lastStatusCheckTime = Date()
|
||||
}
|
||||
|
||||
// Fetch available products
|
||||
await loadProducts()
|
||||
|
||||
Reference in New Issue
Block a user