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:
Alex 2025-03-20 22:30:27 -05:00 committed by GitHub
parent dbc279f843
commit bcd9248b43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts">
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 { AssetAction } from '$lib/constants';
import { toggleArchive } from '$lib/utils/asset-utils';
@ -11,11 +11,15 @@
interface Props {
asset: AssetResponseDto;
onAction: OnAction;
preAction: PreAction;
}
let { asset, onAction }: Props = $props();
let { asset, onAction, preAction }: Props = $props();
const onArchive = async () => {
if (!asset.isArchived) {
preAction({ type: AssetAction.ARCHIVE, asset });
}
const updatedAsset = await toggleArchive(asset);
if (updatedAsset) {
onAction({ type: asset.isArchived ? AssetAction.ARCHIVE : AssetAction.UNARCHIVE, asset });

View File

@ -181,7 +181,7 @@
{#if asset.type === AssetTypeEnum.Image}
<SetProfilePictureAction {asset} />
{/if}
<ArchiveAction {asset} {onAction} />
<ArchiveAction {asset} {onAction} {preAction} />
<MenuOption
icon={mdiUpload}
onClick={() => openFileUploadDialog({ multiple: false, assetId: asset.id })}

View File

@ -377,7 +377,8 @@
case removeAction:
case AssetAction.TRASH:
case AssetAction.RESTORE:
case AssetAction.DELETE: {
case AssetAction.DELETE:
case AssetAction.ARCHIVE: {
// find the next asset to show or close the viewer
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
(await handleNext()) || (await handlePrevious()) || (await handleClose({ asset: action.asset }));

View File

@ -1120,7 +1120,6 @@ export class AssetStore {
}
if (changedGeometry) {
changedBuckets.add(bucket);
break;
}
}
}

View File

@ -435,7 +435,7 @@
});
const isShared = $derived(viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : album.albumUsers.length > 0);
const isSelectionMode = $derived(
viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,
viewMode === AlbumPageViewMode.SELECT_ASSETS ? true : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,
);
const singleSelect = $derived(
viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : viewMode === AlbumPageViewMode.SELECT_THUMBNAIL,