File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11import WidgetKit
22import KeychainAccess
3+ import WooFoundation
34
45/// Type that represents the all the possible Widget states.
56///
@@ -98,10 +99,14 @@ final class StoreInfoProvider: TimelineProvider {
9899 completion ( timeline)
99100
100101 } catch {
101- // TODO: Dispatch network error entry.
102- print ( " Error: \( error) " )
103- }
104102
103+ // WooFoundation does not expose `DDLOG` types. Should we include them?
104+ print ( " ⛔️ Error fetching today's widget stats: \( error) " )
105+
106+ let reloadDate = Date ( timeIntervalSinceNow: 30 * 60 ) // Ask for a 15 minutes reload.
107+ let timeline = Timeline < StoreInfoEntry > ( entries: [ . error] , policy: . after( reloadDate) )
108+ completion ( timeline)
109+ }
105110 }
106111 }
107112}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ struct StoreInfoWidget: Widget {
1616 case . notConnected:
1717 NotLoggedInView ( )
1818 case . error:
19- EmptyView ( ) // TODO:
19+ UnableToFetchView ( )
2020 case . data( let data) :
2121 StoreInfoView ( entry: data)
2222 }
You can’t perform that action at this time.
0 commit comments