mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 03:46:47 +01: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:
parent
c5504aae6e
commit
3581069c2b
1 changed files with 10 additions and 4 deletions
|
@ -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 {
|
() async {
|
||||||
processing.value = true;
|
if (showOverlay) processing.value = true;
|
||||||
try {
|
try {
|
||||||
final result = await fun();
|
final result = await fun();
|
||||||
if (result.runtimeType != bool || result == true) {
|
if (result.runtimeType != bool || result == true) {
|
||||||
|
@ -364,7 +367,7 @@ class MultiselectGrid extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
processing.value = false;
|
if (showOverlay) processing.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -383,7 +386,10 @@ class MultiselectGrid extends HookConsumerWidget {
|
||||||
selectionActive: selectionEnabledHook.value,
|
selectionActive: selectionEnabledHook.value,
|
||||||
onRefresh: onRefresh == null
|
onRefresh: onRefresh == null
|
||||||
? null
|
? null
|
||||||
: wrapLongRunningFun(onRefresh!),
|
: wrapLongRunningFun(
|
||||||
|
onRefresh!,
|
||||||
|
showOverlay: false,
|
||||||
|
),
|
||||||
topWidget: topWidget,
|
topWidget: topWidget,
|
||||||
showStack: stackEnabled,
|
showStack: stackEnabled,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue