1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

feat(web): persist info panel (#3013)

Signed-off-by: martabal <74269598+martabal@users.noreply.github.com>
This commit is contained in:
martin 2023-06-29 04:14:16 +02:00 committed by GitHub
parent 1ab05e8de0
commit fbd98ec0f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -24,6 +24,7 @@
import VideoViewer from './video-viewer.svelte';
import { assetStore } from '$lib/stores/assets.store';
import { isShowDetail } from '$lib/stores/preferences.store';
import { addAssetsToAlbum, getFilenameExtension } from '$lib/utils/asset-utils';
import { browser } from '$app/environment';
@ -35,7 +36,6 @@
const dispatch = createEventDispatcher();
let halfLeftHover = false;
let halfRightHover = false;
let isShowDetail = false;
let appearsInAlbums: AlbumResponseDto[] = [];
let isShowAlbumPicker = false;
let addToSharedAlbum = true;
@ -81,7 +81,7 @@
deleteAsset();
return;
case 'i':
isShowDetail = !isShowDetail;
$isShowDetail = !$isShowDetail;
return;
case 'ArrowLeft':
navigateAssetBackward();
@ -93,7 +93,7 @@
};
const handleCloseViewer = () => {
isShowDetail = false;
$isShowDetail = false;
closeViewer();
};
@ -112,7 +112,7 @@
};
const showDetailInfoHandler = () => {
isShowDetail = !isShowDetail;
$isShowDetail = !$isShowDetail;
};
const handleDownload = () => {
@ -401,7 +401,7 @@
</div>
{/if}
{#if isShowDetail}
{#if $isShowDetail}
<div
transition:fly={{ duration: 150 }}
id="detail-panel"
@ -411,7 +411,7 @@
<DetailPanel
{asset}
albums={appearsInAlbums}
on:close={() => (isShowDetail = false)}
on:close={() => ($isShowDetail = false)}
on:close-viewer={handleCloseViewer}
on:description-focus-in={disableKeyDownEvent}
on:description-focus-out={enableKeyDownEvent}

View File

@ -38,6 +38,8 @@ export const mapSettings = persisted<MapSettings>('map-settings', {
export const videoViewerVolume = persisted<number>('video-viewer-volume', 1, {});
export const isShowDetail = persisted<boolean>('info-opened', false, {});
export interface AlbumViewSettings {
sortBy: string;
}