|
@@ -25,13 +25,14 @@
|
|
import { onMount } from 'svelte';
|
|
import { onMount } from 'svelte';
|
|
import { handleError } from '$lib/utils/handle-error';
|
|
import { handleError } from '$lib/utils/handle-error';
|
|
import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte';
|
|
import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte';
|
|
|
|
+ import { archivedAsset } from '$lib/stores/archived-asset.store';
|
|
|
|
|
|
export let data: PageData;
|
|
export let data: PageData;
|
|
|
|
|
|
onMount(async () => {
|
|
onMount(async () => {
|
|
try {
|
|
try {
|
|
const { data: assets } = await api.assetApi.getAllAssets(undefined, true);
|
|
const { data: assets } = await api.assetApi.getAllAssets(undefined, true);
|
|
- archived = assets;
|
|
|
|
|
|
+ $archivedAsset = assets;
|
|
} catch {
|
|
} catch {
|
|
handleError(Error, 'Unable to load archived assets');
|
|
handleError(Error, 'Unable to load archived assets');
|
|
}
|
|
}
|
|
@@ -54,7 +55,7 @@
|
|
|
|
|
|
for (const asset of deletedAssets) {
|
|
for (const asset of deletedAssets) {
|
|
if (asset.status == 'SUCCESS') {
|
|
if (asset.status == 'SUCCESS') {
|
|
- archived = archived.filter((a) => a.id != asset.id);
|
|
|
|
|
|
+ $archivedAsset = $archivedAsset.filter((a) => a.id != asset.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,7 +73,6 @@
|
|
$: isMultiSelectionMode = selectedAssets.size > 0;
|
|
$: isMultiSelectionMode = selectedAssets.size > 0;
|
|
|
|
|
|
let selectedAssets: Set<AssetResponseDto> = new Set();
|
|
let selectedAssets: Set<AssetResponseDto> = new Set();
|
|
- let archived: AssetResponseDto[] = [];
|
|
|
|
|
|
|
|
let contextMenuPosition = { x: 0, y: 0 };
|
|
let contextMenuPosition = { x: 0, y: 0 };
|
|
let isShowCreateSharedLinkModal = false;
|
|
let isShowCreateSharedLinkModal = false;
|
|
@@ -157,7 +157,7 @@
|
|
});
|
|
});
|
|
cnt = cnt + 1;
|
|
cnt = cnt + 1;
|
|
|
|
|
|
- archived = archived.filter((a) => a.id != asset.id);
|
|
|
|
|
|
+ $archivedAsset = $archivedAsset.filter((a) => a.id != asset.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -181,7 +181,7 @@
|
|
|
|
|
|
<UserPageLayout user={data.user} hideNavbar={isMultiSelectionMode}>
|
|
<UserPageLayout user={data.user} hideNavbar={isMultiSelectionMode}>
|
|
<!-- Empty Message -->
|
|
<!-- Empty Message -->
|
|
- {#if archived.length === 0}
|
|
|
|
|
|
+ {#if $archivedAsset.length === 0}
|
|
<EmptyPlaceholder
|
|
<EmptyPlaceholder
|
|
text="Archive photos and videos to hide them from your Photos view"
|
|
text="Archive photos and videos to hide them from your Photos view"
|
|
alt="Empty archive"
|
|
alt="Empty archive"
|
|
@@ -255,5 +255,5 @@
|
|
{/if}
|
|
{/if}
|
|
</svelte:fragment>
|
|
</svelte:fragment>
|
|
|
|
|
|
- <GalleryViewer assets={archived} bind:selectedAssets />
|
|
|
|
|
|
+ <GalleryViewer assets={$archivedAsset} bind:selectedAssets viewFrom="archive-page" />
|
|
</UserPageLayout>
|
|
</UserPageLayout>
|