Skip to content

fix: slow loading Puzzle Themes for offline users#2854

Open
freebeartogoodhome wants to merge 3 commits intolichess-org:mainfrom
freebeartogoodhome:freebeartogoodhome-puzzlethemes
Open

fix: slow loading Puzzle Themes for offline users#2854
freebeartogoodhome wants to merge 3 commits intolichess-org:mainfrom
freebeartogoodhome:freebeartogoodhome-puzzlethemes

Conversation

@freebeartogoodhome
Copy link
Copy Markdown

Load Puzzle Themes faster for offline users.

Avoid this:
puzzlethemes.webm

Load Puzzle Themes faster for offline users.
I forgot dart format.
@freebeartogoodhome freebeartogoodhome changed the title Update puzzle_themes_screen.dart fix: slow loading Puzzle Themes for offline users Mar 28, 2026
Copy link
Copy Markdown
Contributor

@veloce veloce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how turning this in to an AsyncNotifier that has no method would change anything here.

Correcting for PR comments.
@freebeartogoodhome
Copy link
Copy Markdown
Author

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) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was really just this that I wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants