diff --git a/web/src/lib/components/asset-viewer/asser-viewer-nav-bar.svelte b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte similarity index 85% rename from web/src/lib/components/asset-viewer/asser-viewer-nav-bar.svelte rename to web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte index 09730a0587..4c31e5e17b 100644 --- a/web/src/lib/components/asset-viewer/asser-viewer-nav-bar.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte @@ -4,6 +4,7 @@ import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte'; import CloudDownloadOutline from 'svelte-material-icons/CloudDownloadOutline.svelte'; import InformationOutline from 'svelte-material-icons/InformationOutline.svelte'; + import DeleteOutline from 'svelte-material-icons/DeleteOutline.svelte'; import CircleIconButton from '../shared-components/circle-icon-button.svelte'; const dispatch = createEventDispatcher(); @@ -17,5 +18,6 @@
dispatch('download')} /> dispatch('showDetail')} /> + dispatch('delete')} />
diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte index 90b3a63872..9cad61119b 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte @@ -1,7 +1,7 @@
diff --git a/web/src/lib/stores/asset-interaction.store.ts b/web/src/lib/stores/asset-interaction.store.ts index 48193901c9..d9407cf6ce 100644 --- a/web/src/lib/stores/asset-interaction.store.ts +++ b/web/src/lib/stores/asset-interaction.store.ts @@ -22,7 +22,7 @@ function createAssetInteractionStore() { let _viewingAssetStoreState: AssetResponseDto; let _selectedAssets: Set; let _selectedGroup: Set; - let _assetsInAblums: AssetResponseDto[]; + let _assetsInAlbums: AssetResponseDto[]; let savedAssetLength = 0; let assetSortedByDate: AssetResponseDto[] = []; @@ -44,7 +44,7 @@ function createAssetInteractionStore() { }); assetsInAlbumStoreState.subscribe((assets) => { - _assetsInAblums = assets; + _assetsInAlbums = assets; }); // Methods @@ -95,15 +95,17 @@ function createAssetInteractionStore() { } const nextAsset = assetSortedByDate[nextIndex]; - setViewingAsset(nextAsset); + if (nextAsset) { + setViewingAsset(nextAsset); + } }; /** * Multiselect */ const addAssetToMultiselectGroup = (asset: AssetResponseDto) => { - // Not select if in album alreaady - if (_assetsInAblums.find((a) => a.id === asset.id)) { + // Not select if in album already + if (_assetsInAlbums.find((a) => a.id === asset.id)) { return; } @@ -129,12 +131,13 @@ function createAssetInteractionStore() { const clearMultiselect = () => { _selectedAssets.clear(); _selectedGroup.clear(); - _assetsInAblums = []; + _assetsInAlbums = []; selectedAssets.set(_selectedAssets); selectedGroup.set(_selectedGroup); - assetsInAlbumStoreState.set(_assetsInAblums); + assetsInAlbumStoreState.set(_assetsInAlbums); }; + return { setViewingAsset, setIsViewingAsset,