mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: show dialog before delete local action (#22280)
* fix: show dialog on delete local action # Conflicts: # mobile/lib/repositories/asset_media.repository.dart * button style --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
87466160ae
commit
9a7fcc9eb7
7 changed files with 80 additions and 29 deletions
|
|
@ -260,8 +260,15 @@ class ActionNotifier extends Notifier<void> {
|
|||
}
|
||||
}
|
||||
|
||||
Future<ActionResult> deleteLocal(ActionSource source) async {
|
||||
final ids = _getLocalIdsForSource(source);
|
||||
Future<ActionResult> deleteLocal(ActionSource source, bool backedUpOnly) async {
|
||||
final List<String> ids;
|
||||
if (backedUpOnly) {
|
||||
final assets = _getAssets(source);
|
||||
ids = assets.where((asset) => asset.storage == AssetState.merged).map((asset) => asset.localId!).toList();
|
||||
} else {
|
||||
ids = _getLocalIdsForSource(source);
|
||||
}
|
||||
|
||||
try {
|
||||
final deletedCount = await _service.deleteLocal(ids);
|
||||
return ActionResult(count: deletedCount, success: true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue