mirror of
https://github.com/immich-app/immich.git
synced 2025-11-18 19:42:34 +09:00
fix(mobile): do not show loading overlay on grid refresh (#5531)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user