Onstart sync progressbar: fix potential bug with spinner on interrupt synchronization

This commit is contained in:
HDDen committed 2026-05-26 00:37:42 +03:00
1 parent 4dd472e3c3
commit 2328848400
2 files changed
+13 -3

No files matched your search

+9
View File
@@ -3637,6 +3637,12 @@ class MeshCoreConnector extends ChangeNotifier {
if (completed) {
_hasLoadedChannels = true;
_previousChannelsCache.clear();
} else if (_channels.isEmpty && _previousChannelsCache.isNotEmpty) {
// A failed initial sync should not leave the UI empty/spinning forever.
// Restore the pre-sync list so cached channels remain usable.
_channels.addAll(_previousChannelsCache);
_applyChannelOrder();
_recalculateCachedChannelsUnreadTotal();
}
if (isConnected) {
@@ -3644,6 +3650,9 @@ class MeshCoreConnector extends ChangeNotifier {
}
// Keep cache on failure/disconnection for future attempts
if (!completed) {
notifyListeners();
}
}
void _startPostChannelInitialQueuedMessageSync() {