mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 18:47:09 -04:00 
			
		
		
		
	* chore: add unawaited_futures lint as warning # Conflicts: # mobile/analysis_options.yaml * remove unused dcm lints They will be added back later on a case by case basis * fix warning # Conflicts: # mobile/lib/presentation/pages/drift_remote_album.page.dart * auto gen file * review changes * conflict resolution --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
		
			
				
	
	
		
			22 lines
		
	
	
		
			606 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			606 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'dart:async';
 | |
| 
 | |
| import 'package:auto_route/auto_route.dart';
 | |
| import 'package:immich_mobile/providers/gallery_permission.provider.dart';
 | |
| import 'package:immich_mobile/routing/router.dart';
 | |
| 
 | |
| class BackupPermissionGuard extends AutoRouteGuard {
 | |
|   final GalleryPermissionNotifier _permission;
 | |
| 
 | |
|   const BackupPermissionGuard(this._permission);
 | |
| 
 | |
|   @override
 | |
|   void onNavigation(NavigationResolver resolver, StackRouter router) async {
 | |
|     final p = _permission.hasPermission;
 | |
|     if (p) {
 | |
|       resolver.next(true);
 | |
|     } else {
 | |
|       unawaited(router.push(const PermissionOnboardingRoute()));
 | |
|     }
 | |
|   }
 | |
| }
 |