fix: slow loading Puzzle Themes for offline users#2854
fix: slow loading Puzzle Themes for offline users#2854freebeartogoodhome wants to merge 3 commits intolichess-org:mainfrom
Conversation
Load Puzzle Themes faster for offline users.
I forgot dart format.
veloce
left a comment
There was a problem hiding this comment.
I need more context to understand what is going on here.
Why is it slow when offline? because of a request that times out? then I don't get how this fix would work.
A screen recording where I can see the app offline loads theme fast would be useful too.
Thanks!
| } | ||
| } | ||
|
|
||
| final themesProvider = |
There was a problem hiding this comment.
There's no reason to make it public here.
| final connectivity = await ref.watch(connectivityChangesProvider.future); | ||
| final savedThemes = await ref.watch(savedThemeBatchesProvider.future); | ||
| IMap<PuzzleThemeKey, PuzzleThemeData>? onlineThemes; | ||
| class ThemesNotifier |
There was a problem hiding this comment.
I don't understand how turning this in to an AsyncNotifier that has no method would change anything here.
Correcting for PR comments.
|
Sorry, about that. I have been gone several years. I am learning flutter and dart. I was playing around with a lot. I fixed it now to just the simple change. I wanted to skip all of those network calls when we knew we were offline. Here is a new video. newvideo.webm |
| final connectivity = await ref.watch(connectivityChangesProvider.future); | ||
| final savedThemes = await ref.watch(savedThemeBatchesProvider.future); | ||
| IMap<PuzzleThemeKey, PuzzleThemeData>? onlineThemes; | ||
| if (connectivity.isOnline) { |
There was a problem hiding this comment.
It was really just this that I wanted.
Load Puzzle Themes faster for offline users.
Avoid this:
puzzlethemes.webm