feat(web): improve feedback for favorite and archive actions (#7232)

This commit is contained in:
Michel Heusschen 2024-02-20 17:01:52 +01:00 committed by GitHub
parent b3c7bebbd4
commit b896d45ee7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 24 additions and 12 deletions

View file

@ -11,7 +11,7 @@
import MenuOption from '../../shared-components/context-menu/menu-option.svelte';
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
export let onArchive: OnArchive | undefined = undefined;
export let onArchive: OnArchive;
export let menuItem = false;
export let unarchive = false;
@ -39,7 +39,7 @@
asset.isArchived = isArchived;
}
onArchive?.(ids, isArchived);
onArchive(ids, isArchived);
notificationController.show({
message: `${isArchived ? 'Archived' : 'Unarchived'} ${ids.length}`,

View file

@ -11,7 +11,7 @@
import { mdiHeartMinusOutline, mdiHeartOutline, mdiTimerSand } from '@mdi/js';
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
export let onFavorite: OnFavorite | undefined = undefined;
export let onFavorite: OnFavorite;
export let menuItem = false;
export let removeFavorite: boolean;
@ -40,7 +40,7 @@
asset.isFavorite = isFavorite;
}
onFavorite?.(ids, isFavorite);
onFavorite(ids, isFavorite);
notificationController.show({
message: isFavorite ? `Added ${ids.length} to favorites` : `Removed ${ids.length} from favorites`,

View file

@ -25,6 +25,7 @@
export let viewport: Viewport;
export let singleSelect = false;
export let withStacked = false;
export let showArchiveIcon = false;
export let assetStore: AssetStore;
export let assetInteractionStore: AssetInteractionStore;
@ -170,6 +171,7 @@
>
<Thumbnail
showStackedIcon={withStacked}
{showArchiveIcon}
{asset}
{groupIndex}
on:click={() => assetClickHandler(asset, groupAssets, groupTitle)}

View file

@ -28,6 +28,7 @@
export let assetInteractionStore: AssetInteractionStore;
export let removeAction: AssetAction | null = null;
export let withStacked = false;
export let showArchiveIcon = false;
export let isShared = false;
export let album: AlbumResponseDto | null = null;
export let isShowDeleteConfirmation = false;
@ -425,6 +426,7 @@
{#if intersecting}
<AssetDateGroup
{withStacked}
{showArchiveIcon}
{assetStore}
{assetInteractionStore}
{isSelectionMode}