1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

fix(web): unstacking issues (#4792)

* Fix typo

* Restore asset store consistency after unstacking

* Fix aspect ratio after unstacking
This commit is contained in:
Sergey Kondrikov 2023-11-03 17:01:48 +03:00 committed by GitHub
parent 92bb42950e
commit 38443a6068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View file

@ -109,7 +109,9 @@ export class AssetRepository implements IAssetRepository {
faces: {
person: true,
},
stack: true,
stack: {
exifInfo: true,
},
},
// We are specifically asking for this asset. Return it even if it is soft deleted
withDeleted: true,

View file

@ -32,7 +32,7 @@
export let showDownloadButton: boolean;
export let showDetailButton: boolean;
export let showSlideshow = false;
export let hasStackChildern = false;
export let hasStackChildren = false;
$: isOwner = asset.ownerId === $page.data.user?.id;
@ -176,7 +176,7 @@
/>
<MenuOption on:click={() => onMenuClick('asProfileImage')} text="As profile picture" />
{#if hasStackChildern}
{#if hasStackChildren}
<MenuOption on:click={() => onMenuClick('unstack')} text="Un-Stack" />
{/if}

View file

@ -549,7 +549,7 @@
}
asset.stackCount = 0;
asset.stack = [];
assetStore?.updateAsset(asset);
assetStore?.updateAsset(asset, true);
dispatch('unstack');
notificationController.show({ type: NotificationType.Info, message: 'Un-stacked', timeout: 1500 });
@ -575,7 +575,7 @@
showDownloadButton={shouldShowDownloadButton}
showDetailButton={shouldShowDetailButton}
showSlideshow={!!assetStore}
hasStackChildern={$stackAssetsStore.length > 0}
hasStackChildren={$stackAssetsStore.length > 0}
on:goBack={closeViewer}
on:showDetail={showDetailInfoHandler}
on:download={() => downloadFile(asset)}

View file

@ -317,7 +317,7 @@ export class AssetStore {
return bucket.assets[Math.floor(Math.random() * bucket.assets.length)] || null;
}
updateAsset(_asset: AssetResponseDto) {
updateAsset(_asset: AssetResponseDto, recalculate = false) {
const asset = this.assets.find((asset) => asset.id === _asset.id);
if (!asset) {
return;
@ -325,7 +325,7 @@ export class AssetStore {
Object.assign(asset, _asset);
this.emit(false);
this.emit(recalculate);
}
removeAssets(ids: string[]) {