mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:29:32 -05:00 
			
		
		
		
	fix(web): trash page now auto refreshes (#8978)
* fix(web): the trash page now auto refreshes when restore all or empty trash is clicked. Also shows number of assets affected. * formatting
This commit is contained in:
		
							parent
							
								
									21231d53a5
								
							
						
					
					
						commit
						f004487be0
					
				@ -39,8 +39,12 @@
 | 
			
		||||
    try {
 | 
			
		||||
      await emptyTrash();
 | 
			
		||||
 | 
			
		||||
      const deletedAssetIds = assetStore.assets.map((a) => a.id);
 | 
			
		||||
      const numberOfAssets = deletedAssetIds.length;
 | 
			
		||||
      assetStore.removeAssets(deletedAssetIds);
 | 
			
		||||
 | 
			
		||||
      notificationController.show({
 | 
			
		||||
        message: `Empty trash initiated. Refresh the page to see the changes`,
 | 
			
		||||
        message: `Permanently deleted ${numberOfAssets} ${numberOfAssets == 1 ? 'asset' : 'assets'}`,
 | 
			
		||||
        type: NotificationType.Info,
 | 
			
		||||
      });
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
@ -52,8 +56,12 @@
 | 
			
		||||
    try {
 | 
			
		||||
      await restoreTrash();
 | 
			
		||||
 | 
			
		||||
      const restoredAssetIds = assetStore.assets.map((a) => a.id);
 | 
			
		||||
      const numberOfAssets = restoredAssetIds.length;
 | 
			
		||||
      assetStore.removeAssets(restoredAssetIds);
 | 
			
		||||
 | 
			
		||||
      notificationController.show({
 | 
			
		||||
        message: `Restore trash initiated. Refresh the page to see the changes`,
 | 
			
		||||
        message: `Restored ${numberOfAssets} ${numberOfAssets == 1 ? 'asset' : 'assets'}`,
 | 
			
		||||
        type: NotificationType.Info,
 | 
			
		||||
      });
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user