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 Function() wrapLongRunningFun(Future Function() fun) => + Future Function() wrapLongRunningFun( + Future 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, ),