diff --git a/mobile/lib/features/servers/servers_tab.dart b/mobile/lib/features/servers/servers_tab.dart index 5097468..dac3851 100644 --- a/mobile/lib/features/servers/servers_tab.dart +++ b/mobile/lib/features/servers/servers_tab.dart @@ -182,6 +182,11 @@ class _ServersTabState extends ConsumerState { ], ), body: RefreshIndicator( + color: Theme.of(context).colorScheme.primary, + backgroundColor: Theme.of(context).colorScheme.surface, + displacement: 30, + edgeOffset: 6, + strokeWidth: 2, onRefresh: _refresh, child: AnimatedBuilder( animation: manager, diff --git a/mobile/lib/state/host_list_notifier.dart b/mobile/lib/state/host_list_notifier.dart index 86d2a0b..36bc2cb 100644 --- a/mobile/lib/state/host_list_notifier.dart +++ b/mobile/lib/state/host_list_notifier.dart @@ -21,7 +21,10 @@ class HostListNotifier extends AsyncNotifier> { } Future refresh() async { - state = const AsyncLoading(); + final previous = state.valueOrNull; + if (previous == null) { + state = const AsyncLoading(); + } state = await AsyncValue.guard(() async { try { return await ref.read(serverRepositoryProvider).fetchHosts(); @@ -30,6 +33,9 @@ class HostListNotifier extends AsyncNotifier> { rethrow; } }); + if (state.hasError && previous != null) { + state = AsyncData(previous); + } } }