fix(mobile): restore button in asset viewer (#8919)

* fix:(mobile): spell error in top_control_app_bar.dart in function buildAddToAlbumButtom

* fix(mobile): add restore button to individual image view of trashed assets

* formatting
This commit is contained in:
Conner Hnatiuk
2024-04-26 00:01:03 -06:00
committed by GitHub
parent 59537f8f1b
commit 3e03f5348f
4 changed files with 70 additions and 2 deletions

View File

@@ -30,6 +30,20 @@ class TrashService {
}
}
Future<bool> restoreAsset(Asset asset) async {
try {
if (asset.isRemote) {
List<String> remoteId = [asset.remoteId!];
await _apiService.trashApi.restoreAssets(BulkIdsDto(ids: remoteId));
}
return true;
} catch (error, stack) {
_log.severe("Cannot restore assets", error, stack);
return false;
}
}
Future<void> emptyTrash() async {
try {
await _apiService.trashApi.emptyTrash();