mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:39:37 -05:00 
			
		
		
		
	fix(mobile): assetList is empty (#4213)
* fix(mobile): assetList is empty * add comments --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
		
							parent
							
								
									3bef456923
								
							
						
					
					
						commit
						c0ce81ca0e
					
				@ -218,6 +218,12 @@ class BackupNotifier extends StateNotifier<BackUpState> {
 | 
				
			|||||||
      final assetCountInAlbum = await album.assetCountAsync;
 | 
					      final assetCountInAlbum = await album.assetCountAsync;
 | 
				
			||||||
      if (assetCountInAlbum > 0) {
 | 
					      if (assetCountInAlbum > 0) {
 | 
				
			||||||
        final assetList = await album.getAssetListPaged(page: 0, size: 1);
 | 
					        final assetList = await album.getAssetListPaged(page: 0, size: 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Even though we check assetCountInAlbum to make sure that there are assets in album
 | 
				
			||||||
 | 
					        // The `getAssetListPaged` method still return empty list and cause not assets get rendered
 | 
				
			||||||
 | 
					        if (assetList.isEmpty) {
 | 
				
			||||||
 | 
					          continue;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        final thumbnailAsset = assetList.first;
 | 
					        final thumbnailAsset = assetList.first;
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          final thumbnailData = await thumbnailAsset
 | 
					          final thumbnailData = await thumbnailAsset
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user