mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:39:37 -05:00 
			
		
		
		
	fix(web): unstack after stack child selection (#4834)
This commit is contained in:
		
							parent
							
								
									de29480dda
								
							
						
					
					
						commit
						cf1dfdc776
					
				@ -545,11 +545,10 @@
 | 
				
			|||||||
      await api.assetApi.updateAssets({ assetBulkUpdateDto: { ids, removeParent: true } });
 | 
					      await api.assetApi.updateAssets({ assetBulkUpdateDto: { ids, removeParent: true } });
 | 
				
			||||||
      for (const child of $stackAssetsStore) {
 | 
					      for (const child of $stackAssetsStore) {
 | 
				
			||||||
        child.stackParentId = null;
 | 
					        child.stackParentId = null;
 | 
				
			||||||
 | 
					        child.stackCount = 0;
 | 
				
			||||||
 | 
					        child.stack = [];
 | 
				
			||||||
        assetStore?.addAsset(child);
 | 
					        assetStore?.addAsset(child);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      asset.stackCount = 0;
 | 
					 | 
				
			||||||
      asset.stack = [];
 | 
					 | 
				
			||||||
      assetStore?.updateAsset(asset, true);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      dispatch('unstack');
 | 
					      dispatch('unstack');
 | 
				
			||||||
      notificationController.show({ type: NotificationType.Info, message: 'Un-stacked', timeout: 1500 });
 | 
					      notificationController.show({ type: NotificationType.Info, message: 'Un-stacked', timeout: 1500 });
 | 
				
			||||||
 | 
				
			|||||||
@ -261,6 +261,9 @@ export class AssetStore {
 | 
				
			|||||||
      isMismatched(this.options.isArchived, asset.isArchived) ||
 | 
					      isMismatched(this.options.isArchived, asset.isArchived) ||
 | 
				
			||||||
      isMismatched(this.options.isFavorite, asset.isFavorite)
 | 
					      isMismatched(this.options.isFavorite, asset.isFavorite)
 | 
				
			||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
 | 
					      // If asset is already in the bucket we don't need to recalculate
 | 
				
			||||||
 | 
					      // asset store containers
 | 
				
			||||||
 | 
					      this.updateAsset(asset);
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -290,6 +293,11 @@ export class AssetStore {
 | 
				
			|||||||
      const bDate = DateTime.fromISO(b.fileCreatedAt).toUTC();
 | 
					      const bDate = DateTime.fromISO(b.fileCreatedAt).toUTC();
 | 
				
			||||||
      return bDate.diff(aDate).milliseconds;
 | 
					      return bDate.diff(aDate).milliseconds;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // If we added an asset to the store, we need to recalculate
 | 
				
			||||||
 | 
					    // asset store containers
 | 
				
			||||||
 | 
					    this.assets.push(asset);
 | 
				
			||||||
 | 
					    this.updateAsset(asset, true);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getBucketByDate(bucketDate: string): AssetBucket | null {
 | 
					  getBucketByDate(bucketDate: string): AssetBucket | null {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user