Skip to content

High performance self-hosted photo and video management solution.

fix(mobile): do not show loading overlay on grid refresh (#5531)

shenlong3581069c2bdb
diff --git a/mobile/lib/shared/ui/asset_grid/multiselect_grid.dart b/mobile/lib/shared/ui/asset_grid/multiselect_grid.dart
index 8c8544740b..2a8923657c 100644
--- a/mobile/lib/shared/ui/asset_grid/multiselect_grid.dart
+++ b/mobile/lib/shared/ui/asset_grid/multiselect_grid.dart
@@ -354,9 +354,12 @@ class MultiselectGrid extends HookConsumerWidget {
}
}
- Future<T> Function() wrapLongRunningFun<T>(Future<T> Function() fun) =>
+ Future<T> Function() wrapLongRunningFun<T>(
+ Future<T> Function() fun, {
+ bool showOverlay = true,
+ }) =>
() async {
- processing.value = true;
+ if (showOverlay) processing.value = true;
try {
final result = await fun();
if (result.runtimeType != bool || result == true) {
@@ -364,7 +367,7 @@ class MultiselectGrid extends HookConsumerWidget {
}
return result;
} finally {
- processing.value = false;
+ if (showOverlay) processing.value = false;
}
};
@@ -383,7 +386,10 @@ class MultiselectGrid extends HookConsumerWidget {
selectionActive: selectionEnabledHook.value,
onRefresh: onRefresh == null
? null
- : wrapLongRunningFun(onRefresh!),
+ : wrapLongRunningFun(
+ onRefresh!,
+ showOverlay: false,
+ ),
topWidget: topWidget,
showStack: stackEnabled,
),