mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
fix(web): unstacking issues (#4792)
* Fix typo * Restore asset store consistency after unstacking * Fix aspect ratio after unstacking
This commit is contained in:
parent
92bb42950e
commit
38443a6068
4 changed files with 9 additions and 7 deletions
|
@ -109,7 +109,9 @@ export class AssetRepository implements IAssetRepository {
|
||||||
faces: {
|
faces: {
|
||||||
person: true,
|
person: true,
|
||||||
},
|
},
|
||||||
stack: true,
|
stack: {
|
||||||
|
exifInfo: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// We are specifically asking for this asset. Return it even if it is soft deleted
|
// We are specifically asking for this asset. Return it even if it is soft deleted
|
||||||
withDeleted: true,
|
withDeleted: true,
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
export let showDownloadButton: boolean;
|
export let showDownloadButton: boolean;
|
||||||
export let showDetailButton: boolean;
|
export let showDetailButton: boolean;
|
||||||
export let showSlideshow = false;
|
export let showSlideshow = false;
|
||||||
export let hasStackChildern = false;
|
export let hasStackChildren = false;
|
||||||
|
|
||||||
$: isOwner = asset.ownerId === $page.data.user?.id;
|
$: isOwner = asset.ownerId === $page.data.user?.id;
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
/>
|
/>
|
||||||
<MenuOption on:click={() => onMenuClick('asProfileImage')} text="As profile picture" />
|
<MenuOption on:click={() => onMenuClick('asProfileImage')} text="As profile picture" />
|
||||||
|
|
||||||
{#if hasStackChildern}
|
{#if hasStackChildren}
|
||||||
<MenuOption on:click={() => onMenuClick('unstack')} text="Un-Stack" />
|
<MenuOption on:click={() => onMenuClick('unstack')} text="Un-Stack" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
|
@ -549,7 +549,7 @@
|
||||||
}
|
}
|
||||||
asset.stackCount = 0;
|
asset.stackCount = 0;
|
||||||
asset.stack = [];
|
asset.stack = [];
|
||||||
assetStore?.updateAsset(asset);
|
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 });
|
||||||
|
@ -575,7 +575,7 @@
|
||||||
showDownloadButton={shouldShowDownloadButton}
|
showDownloadButton={shouldShowDownloadButton}
|
||||||
showDetailButton={shouldShowDetailButton}
|
showDetailButton={shouldShowDetailButton}
|
||||||
showSlideshow={!!assetStore}
|
showSlideshow={!!assetStore}
|
||||||
hasStackChildern={$stackAssetsStore.length > 0}
|
hasStackChildren={$stackAssetsStore.length > 0}
|
||||||
on:goBack={closeViewer}
|
on:goBack={closeViewer}
|
||||||
on:showDetail={showDetailInfoHandler}
|
on:showDetail={showDetailInfoHandler}
|
||||||
on:download={() => downloadFile(asset)}
|
on:download={() => downloadFile(asset)}
|
||||||
|
|
|
@ -317,7 +317,7 @@ export class AssetStore {
|
||||||
return bucket.assets[Math.floor(Math.random() * bucket.assets.length)] || null;
|
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);
|
const asset = this.assets.find((asset) => asset.id === _asset.id);
|
||||||
if (!asset) {
|
if (!asset) {
|
||||||
return;
|
return;
|
||||||
|
@ -325,7 +325,7 @@ export class AssetStore {
|
||||||
|
|
||||||
Object.assign(asset, _asset);
|
Object.assign(asset, _asset);
|
||||||
|
|
||||||
this.emit(false);
|
this.emit(recalculate);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeAssets(ids: string[]) {
|
removeAssets(ids: string[]) {
|
||||||
|
|
Loading…
Reference in a new issue