mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(mobile): back gesture in asset selection page from an album (#16449)
* fix(mobile): the page for adding photos to the album cannot be navigated back using gestures #16409 * First-time return gesture adds the feature to cancel all current selections --------- Co-authored-by: ExceptionsOccur <yuyu.tao@foxmail.com>
This commit is contained in:
parent
a1a61f19eb
commit
858d1e9d9b
@ -542,7 +542,24 @@ class ImmichAssetGridViewState extends ConsumerState<ImmichAssetGridView> {
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: !(widget.selectionActive && _selectedAssets.isNotEmpty),
|
||||
onPopInvokedWithResult: (didPop, _) => !didPop ? _deselectAll() : null,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (didPop) {
|
||||
return;
|
||||
} else {
|
||||
if (widget.preselectedAssets == null) {
|
||||
Navigator.of(context).canPop() ? Navigator.of(context).pop() : null;
|
||||
}
|
||||
if (_selectedAssets.length != widget.preselectedAssets!.length &&
|
||||
!widget.preselectedAssets!.containsAll(_selectedAssets)) {
|
||||
{
|
||||
_deselectAll();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Navigator.of(context).canPop() ? Navigator.of(context).pop() : null;
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
AssetDragRegion(
|
||||
|
Loading…
x
Reference in New Issue
Block a user