High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
chore: label local only delete as trash (#30726)
shenlong943c11c0196e
diff --git a/mobile/lib/presentation/actions/delete.action.dart b/mobile/lib/presentation/actions/delete.action.dartindex ea7423354a..23a2ef2a2f 100644--- a/mobile/lib/presentation/actions/delete.action.dart+++ b/mobile/lib/presentation/actions/delete.action.dart@@ -37,7 +37,8 @@ final _stateProvider = Provider.family.autoDispose<_State?, ActionSource>((ref,final trashEnabled = ref.watch(serverInfoProvider.select((state) => state.serverFeatures.trash));// Assets already in the trash or in the locked folder are deleted outright, irrespective of the server setting.- final trash = trashEnabled && !ownedRemote.every((asset) => asset.isTrashed || asset.isLocked);+ final trash =+ ownedRemote.isEmpty || (trashEnabled && !ownedRemote.every((asset) => asset.isTrashed || asset.isLocked));return (localIds: localIds, remoteIds: ownedRemote.map((asset) => asset.id).toList(growable: false), trash: trash);}, dependencies: [assetsActionProvider]);diff --git a/mobile/test/unit/presentation/actions/delete_action_test.dart b/mobile/test/unit/presentation/actions/delete_action_test.dartindex 29d81a5c2c..4c1bf9306c 100644--- a/mobile/test/unit/presentation/actions/delete_action_test.dart+++ b/mobile/test/unit/presentation/actions/delete_action_test.dart@@ -170,6 +170,17 @@ void main() {verifyNever(() => assetService.trash(any()));verifyNever(() => assetService.delete(any()));});++ testWidgets('is labelled trash', (tester) async {+ await tester.pumpTestWidget(+ context,+ const ActionButton(action: DeleteAction(source: .timeline)),+ overrides: context.selected({LocalAssetFactory.create()}),+ );++ expect(find.text(StaticTranslations.instance.trash), findsOneWidget);+ expect(find.text(StaticTranslations.instance.delete), findsNothing);+ });});group('prompt handling', () {