fix: show dialog on delete local action

This commit is contained in:
shenlong-tanwen
2025-09-22 04:58:52 +05:30
parent 0be71c82b3
commit 9db0baa42b
7 changed files with 61 additions and 12 deletions
@@ -252,8 +252,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);