1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-28 09:33:27 +02: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:
shenlong 2023-12-07 18:21:07 +00:00 committed by GitHub
parent c5504aae6e
commit 3581069c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
),