mirror of
https://github.com/immich-app/immich.git
synced 2025-05-30 19:54:52 -04:00
fix(web): timeline regression 2 (#16982)
* fix(web): timeline renders nothing after archiving in asset viewer * fix(web): timeline renders nothing after archiving in asset viewer * fix: ensure geometry updated when performing bulk action on all * fix: album assets selection
This commit is contained in:
parent
dbc279f843
commit
bcd9248b43
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { shortcut } from '$lib/actions/shortcut';
|
import { shortcut } from '$lib/actions/shortcut';
|
||||||
import type { OnAction } from '$lib/components/asset-viewer/actions/action';
|
import type { OnAction, PreAction } from '$lib/components/asset-viewer/actions/action';
|
||||||
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
|
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
|
||||||
import { AssetAction } from '$lib/constants';
|
import { AssetAction } from '$lib/constants';
|
||||||
import { toggleArchive } from '$lib/utils/asset-utils';
|
import { toggleArchive } from '$lib/utils/asset-utils';
|
||||||
@ -11,11 +11,15 @@
|
|||||||
interface Props {
|
interface Props {
|
||||||
asset: AssetResponseDto;
|
asset: AssetResponseDto;
|
||||||
onAction: OnAction;
|
onAction: OnAction;
|
||||||
|
preAction: PreAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { asset, onAction }: Props = $props();
|
let { asset, onAction, preAction }: Props = $props();
|
||||||
|
|
||||||
const onArchive = async () => {
|
const onArchive = async () => {
|
||||||
|
if (!asset.isArchived) {
|
||||||
|
preAction({ type: AssetAction.ARCHIVE, asset });
|
||||||
|
}
|
||||||
const updatedAsset = await toggleArchive(asset);
|
const updatedAsset = await toggleArchive(asset);
|
||||||
if (updatedAsset) {
|
if (updatedAsset) {
|
||||||
onAction({ type: asset.isArchived ? AssetAction.ARCHIVE : AssetAction.UNARCHIVE, asset });
|
onAction({ type: asset.isArchived ? AssetAction.ARCHIVE : AssetAction.UNARCHIVE, asset });
|
||||||
|
@ -181,7 +181,7 @@
|
|||||||
{#if asset.type === AssetTypeEnum.Image}
|
{#if asset.type === AssetTypeEnum.Image}
|
||||||
<SetProfilePictureAction {asset} />
|
<SetProfilePictureAction {asset} />
|
||||||
{/if}
|
{/if}
|
||||||
<ArchiveAction {asset} {onAction} />
|
<ArchiveAction {asset} {onAction} {preAction} />
|
||||||
<MenuOption
|
<MenuOption
|
||||||
icon={mdiUpload}
|
icon={mdiUpload}
|
||||||
onClick={() => openFileUploadDialog({ multiple: false, assetId: asset.id })}
|
onClick={() => openFileUploadDialog({ multiple: false, assetId: asset.id })}
|
||||||
|
@ -377,7 +377,8 @@
|
|||||||
case removeAction:
|
case removeAction:
|
||||||
case AssetAction.TRASH:
|
case AssetAction.TRASH:
|
||||||
case AssetAction.RESTORE:
|
case AssetAction.RESTORE:
|
||||||
case AssetAction.DELETE: {
|
case AssetAction.DELETE:
|
||||||
|
case AssetAction.ARCHIVE: {
|
||||||
// find the next asset to show or close the viewer
|
// find the next asset to show or close the viewer
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||||
(await handleNext()) || (await handlePrevious()) || (await handleClose({ asset: action.asset }));
|
(await handleNext()) || (await handlePrevious()) || (await handleClose({ asset: action.asset }));
|
||||||
|
@ -1120,7 +1120,6 @@ export class AssetStore {
|
|||||||
}
|
}
|
||||||
if (changedGeometry) {
|
if (changedGeometry) {
|
||||||
changedBuckets.add(bucket);
|
changedBuckets.add(bucket);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@
|
|||||||
});
|
});
|
||||||
const isShared = $derived(viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : album.albumUsers.length > 0);
|
const isShared = $derived(viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : album.albumUsers.length > 0);
|
||||||
const isSelectionMode = $derived(
|
const isSelectionMode = $derived(
|
||||||
viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,
|
viewMode === AlbumPageViewMode.SELECT_ASSETS ? true : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,
|
||||||
);
|
);
|
||||||
const singleSelect = $derived(
|
const singleSelect = $derived(
|
||||||
viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,
|
viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user