fix: show delete on device when asset has a local match (#22143)

* fix: show delete on device when asset has a local match

* change test description

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-09-17 21:48:54 +05:30 committed by GitHub
parent 20733bd7df
commit 53c67f4d71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -102,7 +102,7 @@ enum ActionButtonType {
context.asset.hasRemote,
ActionButtonType.deleteLocal =>
!context.isInLockedView && //
context.asset.storage == AssetState.local,
context.asset.hasLocal,
ActionButtonType.upload =>
!context.isInLockedView && //
context.asset.storage == AssetState.local,

View File

@ -502,6 +502,21 @@ void main() {
expect(ActionButtonType.deleteLocal.shouldShow(context), isFalse);
});
test('should show when asset is merged', () {
final context = ActionButtonContext(
asset: mergedAsset,
isOwner: true,
isArchived: false,
isTrashEnabled: true,
isInLockedView: false,
currentAlbum: null,
advancedTroubleshooting: false,
source: ActionSource.timeline,
);
expect(ActionButtonType.deleteLocal.shouldShow(context), isTrue);
});
});
group('upload button', () {