mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	fix(mobile): remove locate asset button from trashed asset (#17503)
* fix: remove locate asset button from trashed asset * chore: refactor code
This commit is contained in:
		
							parent
							
								
									92f0973a46
								
							
						
					
					
						commit
						52d4b2fe57
					
				@ -7,6 +7,7 @@ import 'package:immich_mobile/entities/asset.entity.dart';
 | 
				
			|||||||
import 'package:immich_mobile/providers/asset.provider.dart';
 | 
					import 'package:immich_mobile/providers/asset.provider.dart';
 | 
				
			||||||
import 'package:immich_mobile/providers/tab.provider.dart';
 | 
					import 'package:immich_mobile/providers/tab.provider.dart';
 | 
				
			||||||
import 'package:immich_mobile/widgets/asset_viewer/motion_photo_button.dart';
 | 
					import 'package:immich_mobile/widgets/asset_viewer/motion_photo_button.dart';
 | 
				
			||||||
 | 
					import 'package:immich_mobile/providers/asset_viewer/current_asset.provider.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TopControlAppBar extends HookConsumerWidget {
 | 
					class TopControlAppBar extends HookConsumerWidget {
 | 
				
			||||||
  const TopControlAppBar({
 | 
					  const TopControlAppBar({
 | 
				
			||||||
@ -166,6 +167,9 @@ class TopControlAppBar extends HookConsumerWidget {
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bool isInHomePage = ref.read(tabProvider.notifier).state == TabEnum.home;
 | 
				
			||||||
 | 
					    bool? isInTrash = ref.read(currentAssetProvider)?.isTrashed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return AppBar(
 | 
					    return AppBar(
 | 
				
			||||||
      foregroundColor: Colors.grey[100],
 | 
					      foregroundColor: Colors.grey[100],
 | 
				
			||||||
      backgroundColor: Colors.transparent,
 | 
					      backgroundColor: Colors.transparent,
 | 
				
			||||||
@ -174,7 +178,7 @@ class TopControlAppBar extends HookConsumerWidget {
 | 
				
			|||||||
      shape: const Border(),
 | 
					      shape: const Border(),
 | 
				
			||||||
      actions: [
 | 
					      actions: [
 | 
				
			||||||
        if (asset.isRemote && isOwner) buildFavoriteButton(a),
 | 
					        if (asset.isRemote && isOwner) buildFavoriteButton(a),
 | 
				
			||||||
        if (isOwner && ref.read(tabProvider.notifier).state != TabEnum.home)
 | 
					        if (isOwner && !isInHomePage && !(isInTrash ?? false))
 | 
				
			||||||
          buildLocateButton(),
 | 
					          buildLocateButton(),
 | 
				
			||||||
        if (asset.livePhotoVideoId != null) const MotionPhotoButton(),
 | 
					        if (asset.livePhotoVideoId != null) const MotionPhotoButton(),
 | 
				
			||||||
        if (asset.isLocal && !asset.isRemote) buildUploadButton(),
 | 
					        if (asset.isLocal && !asset.isRemote) buildUploadButton(),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user