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:
@@ -178,7 +178,6 @@ class UserDefaultsStore {
|
||||
case customWidget
|
||||
case customMoodTint
|
||||
case customMoodTintUpdateNumber
|
||||
case textColor
|
||||
case showNSFW
|
||||
case shape
|
||||
case daysFilter
|
||||
@@ -200,24 +199,47 @@ class UserDefaultsStore {
|
||||
case currentSelectedHeaderViewViewType
|
||||
}
|
||||
|
||||
/// Cached onboarding data to avoid repeated JSON decoding
|
||||
private static var cachedOnboardingData: OnboardingData?
|
||||
|
||||
static func getOnboarding() -> OnboardingData {
|
||||
// Return cached data if available
|
||||
if let cached = cachedOnboardingData {
|
||||
return cached
|
||||
}
|
||||
|
||||
// Decode and cache
|
||||
if let data = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.savedOnboardingData.rawValue) as? Data,
|
||||
let model = try? JSONDecoder().decode(OnboardingData.self, from: data) {
|
||||
cachedOnboardingData = model
|
||||
return model
|
||||
} else {
|
||||
return OnboardingData()
|
||||
let defaultData = OnboardingData()
|
||||
cachedOnboardingData = defaultData
|
||||
return defaultData
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Invalidate cached onboarding data (call when data might have changed externally)
|
||||
static func invalidateOnboardingCache() {
|
||||
cachedOnboardingData = nil
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
static func saveOnboarding(onboardingData: OnboardingData) -> OnboardingData {
|
||||
// Invalidate cache before saving
|
||||
cachedOnboardingData = nil
|
||||
|
||||
do {
|
||||
let data = try JSONEncoder().encode(onboardingData)
|
||||
GroupUserDefaults.groupDefaults.set(data, forKey: UserDefaultsStore.Keys.savedOnboardingData.rawValue)
|
||||
} catch {
|
||||
print("Error saving onboarding: \(error)")
|
||||
}
|
||||
return UserDefaultsStore.getOnboarding()
|
||||
|
||||
// Re-cache the saved data
|
||||
cachedOnboardingData = onboardingData
|
||||
return onboardingData
|
||||
}
|
||||
|
||||
static func moodMoodImagable() -> MoodImagable.Type {
|
||||
|
||||
Reference in New Issue
Block a user