mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(mobile): items not deselecting on back button (#17403)
* fix: items not deselecting on back button * chore: add comments
This commit is contained in:
parent
1e4b9ae5b7
commit
a724f147fe
@ -546,15 +546,16 @@ class ImmichAssetGridViewState extends ConsumerState<ImmichAssetGridView> {
|
||||
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;
|
||||
}
|
||||
/// `preselectedAssets` is only present when opening the asset grid from the
|
||||
/// "add to album" button.
|
||||
///
|
||||
/// `_selectedAssets` includes `preselectedAssets` on initialization.
|
||||
if (_selectedAssets.length >
|
||||
(widget.preselectedAssets?.length ?? 0)) {
|
||||
/// `_deselectAll` only deselects the selected assets,
|
||||
/// doesn't affect the preselected ones.
|
||||
_deselectAll();
|
||||
return;
|
||||
} else {
|
||||
Navigator.of(context).canPop() ? Navigator.of(context).pop() : null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user