From 316513e5160fbe3a6db0cabb4e0e63139b7bfad5 Mon Sep 17 00:00:00 2001 From: Trey t Date: Tue, 9 Dec 2025 23:09:12 -0600 Subject: [PATCH] Fix widget Mood type inference errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use explicit Mood.missing and Mood.placeholder instead of shorthand - Replace non-existent getAllData() with getData() using full date range 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- FeelsWidget/FeelsVoteWidget.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/FeelsWidget/FeelsVoteWidget.swift b/FeelsWidget/FeelsVoteWidget.swift index 2b6bc97..e3cd6a1 100644 --- a/FeelsWidget/FeelsVoteWidget.swift +++ b/FeelsWidget/FeelsVoteWidget.swift @@ -74,7 +74,7 @@ struct VoteWidgetProvider: TimelineProvider { // Check if user has voted today let todayEntry = PersistenceController.shared.getData(startDate: dayStart, endDate: dayEnd, includedDays: []).first - let hasVotedToday = todayEntry != nil && todayEntry?.mood != .missing && todayEntry?.mood != .placeholder + let hasVotedToday = todayEntry != nil && todayEntry?.mood != Mood.missing && todayEntry?.mood != Mood.placeholder // Get today's mood if voted let todaysMood: Mood? = hasVotedToday ? todayEntry?.mood : nil @@ -82,8 +82,12 @@ struct VoteWidgetProvider: TimelineProvider { // Get stats for display after voting var stats: MoodStats? = nil if hasVotedToday { - let allEntries = PersistenceController.shared.getAllData() - let validEntries = allEntries.filter { $0.mood != .missing && $0.mood != .placeholder } + let allEntries = PersistenceController.shared.getData( + startDate: Date(timeIntervalSince1970: 0), + endDate: Date(), + includedDays: [] + ) + let validEntries = allEntries.filter { $0.mood != Mood.missing && $0.mood != Mood.placeholder } let totalCount = validEntries.count if totalCount > 0 {