feat(mobile): trash/restore all (#28116)

* feat(mobile): trash/restore all

* chore: remove themeData variable

* chore: filter query by user

* refactor

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Yaros
2026-05-12 21:56:19 +02:00
committed by GitHub
parent 91ac56cef2
commit 3e1c8aacb1
5 changed files with 144 additions and 0 deletions
@@ -239,6 +239,26 @@ class ActionNotifier extends Notifier<void> {
}
}
Future<ActionResult> emptyTrash(String userId) async {
try {
final count = await _service.emptyTrash(userId);
return ActionResult(count: count, success: true);
} catch (error, stack) {
_logger.severe('Failed to empty trash', error, stack);
return ActionResult(count: 0, success: false, error: error.toString());
}
}
Future<ActionResult> restoreAllTrash(String userId) async {
try {
final count = await _service.restoreAllTrash(userId);
return ActionResult(count: count, success: true);
} catch (error, stack) {
_logger.severe('Failed to restore all trash assets', error, stack);
return ActionResult(count: 0, success: false, error: error.toString());
}
}
Future<ActionResult> trashRemoteAndDeleteLocal(ActionSource source) async {
final ids = _getOwnedRemoteIdsForSource(source);
final localIds = _getLocalIdsForSource(source);