fix(livetv): keep the favorites filter narrow while favorites reload

Only the load that commits a favorites set writes the loaded flag, so a
refresh keeps the previous set authoritative. Clearing it up front widened
the guide to the full lineup for the whole round-trip and moved the D-pad
cursor when it collapsed back.
This commit is contained in:
edde746
2026-07-27 17:44:52 +02:00
parent e3cdc2039e
commit 6b87b6551e
2 changed files with 58 additions and 11 deletions
+3 -1
View File
@@ -82,6 +82,9 @@ class _LiveTvScreenState extends State<LiveTvScreen>
int _favoritesLoadGeneration = 0;
Future<void>? _favoritesLoadFuture;
final SerialFutureQueue _favoritesMutationQueue = SerialFutureQueue();
/// True while [_favoriteChannels] holds an authoritative set. A refresh keeps the previous set live until the new
/// one commits, so the favorites filter never widens mid-load.
bool _favoritesLoaded = false;
bool _favoritesWritable = false;
@@ -423,7 +426,6 @@ class _LiveTvScreenState extends State<LiveTvScreen>
Future<void> _loadFavorites(MultiServerProvider multiServer) async {
final loadGeneration = ++_favoritesLoadGeneration;
_favoritesLoaded = false;
_favoritesWritable = false;
final previousStoreBySource = Map<String, String>.of(_favoriteStoreBySource);
final scopeByLiveServer = Map<String, _FavoriteScope>.of(_favoriteScopeByLiveServer);