refactor: auto advance asset viewer (#3554)

This commit is contained in:
Jason Rasmussen
2023-08-04 23:26:28 -04:00
committed by GitHub
parent c6abef186c
commit 68b5202730
16 changed files with 77 additions and 78 deletions
+3 -2
View File
@@ -12,6 +12,7 @@
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
import MemoryLane from '$lib/components/photos-page/memory-lane.svelte';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import { AssetAction } from '$lib/constants';
import { createAssetInteractionStore } from '$lib/stores/asset-interaction.store';
import { AssetStore } from '$lib/stores/assets.store';
import { openFileUploadDialog } from '$lib/utils/file-uploader';
@@ -31,7 +32,7 @@
$: isAllFavorite = Array.from($selectedAssets).every((asset) => asset.isFavorite);
onMount(async () => {
const { data: stats } = await api.assetApi.getAssetStats();
const { data: stats } = await api.assetApi.getAssetStats({ isArchived: false });
assetCount = stats.total;
});
</script>
@@ -57,7 +58,7 @@
</svelte:fragment>
<svelte:fragment slot="content">
{#if assetCount}
<AssetGrid {assetStore} {assetInteractionStore}>
<AssetGrid {assetStore} {assetInteractionStore} removeAction={AssetAction.ARCHIVE}>
<MemoryLane />
</AssetGrid>
{:else}