From baf533de35e7fa05bf6fe445de25fd50e00f6c7a Mon Sep 17 00:00:00 2001 From: Matthias Rupp Date: Fri, 24 Jun 2022 17:02:09 +0200 Subject: [PATCH] Delete assets from server if local deletion fails (#260) * Delete assets from server if local deletion fails * Remove commented line --- mobile/lib/shared/providers/asset.provider.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mobile/lib/shared/providers/asset.provider.dart b/mobile/lib/shared/providers/asset.provider.dart index c362b3b0c2..99d6632d63 100644 --- a/mobile/lib/shared/providers/asset.provider.dart +++ b/mobile/lib/shared/providers/asset.provider.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/modules/home/models/delete_asset_response.model.dart'; import 'package:immich_mobile/modules/home/services/asset.service.dart'; @@ -45,9 +46,12 @@ class AssetNotifier extends StateNotifier> { } } } - - // final List result = await PhotoManager.editor.deleteWithIds(deleteIdList); - await PhotoManager.editor.deleteWithIds(deleteIdList); + + try { + await PhotoManager.editor.deleteWithIds(deleteIdList); + } catch (e) { + debugPrint("Delete asset from device failed: $e"); + } // Delete asset on server List? deleteAssetResult =