mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
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:
parent
59537f8f1b
commit
3e03f5348f
4 changed files with 70 additions and 2 deletions
|
|
@ -75,6 +75,28 @@ class TrashNotifier extends StateNotifier<bool> {
|
|||
return false;
|
||||
}
|
||||
|
||||
Future<bool> restoreAsset(Asset asset) async {
|
||||
try {
|
||||
final result = await _trashService.restoreAsset(asset);
|
||||
|
||||
if (result) {
|
||||
final remoteAsset = asset.isRemote;
|
||||
|
||||
asset.isTrashed = false;
|
||||
|
||||
if (remoteAsset) {
|
||||
await _db.writeTxn(() async {
|
||||
await _db.assets.put(asset);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} catch (error, stack) {
|
||||
_log.severe("Cannot restore asset", error, stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<bool> restoreAssets(Iterable<Asset> assetList) async {
|
||||
try {
|
||||
final result = await _trashService.restoreAssets(assetList);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue