Commit cd7d798
committed
Refactor widget and worker to use UserPreferencesRepository
Refactored DayAheadWidget and WidgetUpdateWorker to use UserPreferencesRepository instead of accessing SharedPreferences directly.
This improves architectural consistency and centralizes data access logic.
Changes:
- Updated UserPreferencesRepository to expose summary flow and hasLocation method.
- Updated DayAheadWidget to inject UserPreferencesRepository and collect summary flow.
- Updated WidgetUpdateWorker to inject UserPreferencesRepository and use it for location check, preference retrieval, and summary saving.
- Addressed code review feedback: Added try-catch block in MainViewModel.fetchWeather.1 parent 087a507 commit cd7d798
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
0 commit comments