mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(mobile): Multiselect add to favorite from the timeline (#1558)
* multiselect add to favorites
This commit is contained in:
@@ -277,14 +277,12 @@ class AssetNotifier extends StateNotifier<AssetsState> {
|
||||
return asset.isFavorite;
|
||||
}
|
||||
|
||||
await _updateAssetsState(
|
||||
state.allAssets.map((a) {
|
||||
if (asset.id == a.id) {
|
||||
return Asset.remote(newAsset);
|
||||
}
|
||||
return a;
|
||||
}).toList(),
|
||||
);
|
||||
final index = state.allAssets.indexWhere((a) => asset.id == a.id);
|
||||
if (index > 0) {
|
||||
state.allAssets.removeAt(index);
|
||||
state.allAssets.insert(index, Asset.remote(newAsset));
|
||||
_updateAssetsState(state.allAssets);
|
||||
}
|
||||
|
||||
return newAsset.isFavorite;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user