forked from Cutlery/immich
		
	feat(mobile): Shows a toast after adding to favorites (#1714)
* shows toast on adding assets to favorites * add to favorites first * typo
This commit is contained in:
		
							parent
							
								
									b71a86142b
								
							
						
					
					
						commit
						e6f9d9a31a
					
				@ -101,10 +101,20 @@ class HomePage extends HookConsumerWidget {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      void onFavoriteAssets() {
 | 
					      void onFavoriteAssets() {
 | 
				
			||||||
        final remoteAssests = remoteOnlySelection(
 | 
					        final remoteAssets = remoteOnlySelection(
 | 
				
			||||||
          localErrorMessage: 'Can not favorite local assets yet, skipping',
 | 
					          localErrorMessage: 'Can not favorite local assets yet, skipping',
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssests);
 | 
					        if (remoteAssets.isNotEmpty) {
 | 
				
			||||||
 | 
					          ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssets);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          final assetOrAssets = remoteAssets.length > 1 ? 'assets' : 'asset';
 | 
				
			||||||
 | 
					          ImmichToast.show(
 | 
				
			||||||
 | 
					            context: context,
 | 
				
			||||||
 | 
					            msg: 'Added ${remoteAssets.length} $assetOrAssets to favorites',
 | 
				
			||||||
 | 
					            gravity: ToastGravity.BOTTOM,
 | 
				
			||||||
 | 
					          );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        selectionEnabledHook.value = false;
 | 
					        selectionEnabledHook.value = false;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user