mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
chore: label local only delete as trash (#30726)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
ce705dcc06
commit
943c11c019
2 changed files with 13 additions and 1 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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', () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue