1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-06 11:56:46 +01: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 VideoViewer from './video-viewer.svelte';
import { assetStore } from '$lib/stores/assets.store'; import { assetStore } from '$lib/stores/assets.store';
import { isShowDetail } from '$lib/stores/preferences.store';
import { addAssetsToAlbum, getFilenameExtension } from '$lib/utils/asset-utils'; import { addAssetsToAlbum, getFilenameExtension } from '$lib/utils/asset-utils';
import { browser } from '$app/environment'; import { browser } from '$app/environment';
@ -35,7 +36,6 @@
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
let halfLeftHover = false; let halfLeftHover = false;
let halfRightHover = false; let halfRightHover = false;
let isShowDetail = false;
let appearsInAlbums: AlbumResponseDto[] = []; let appearsInAlbums: AlbumResponseDto[] = [];
let isShowAlbumPicker = false; let isShowAlbumPicker = false;
let addToSharedAlbum = true; let addToSharedAlbum = true;
@ -81,7 +81,7 @@
deleteAsset(); deleteAsset();
return; return;
case 'i': case 'i':
isShowDetail = !isShowDetail; $isShowDetail = !$isShowDetail;
return; return;
case 'ArrowLeft': case 'ArrowLeft':
navigateAssetBackward(); navigateAssetBackward();
@ -93,7 +93,7 @@
}; };
const handleCloseViewer = () => { const handleCloseViewer = () => {
isShowDetail = false; $isShowDetail = false;
closeViewer(); closeViewer();
}; };
@ -112,7 +112,7 @@
}; };
const showDetailInfoHandler = () => { const showDetailInfoHandler = () => {
isShowDetail = !isShowDetail; $isShowDetail = !$isShowDetail;
}; };
const handleDownload = () => { const handleDownload = () => {
@ -401,7 +401,7 @@
</div> </div>
{/if} {/if}
{#if isShowDetail} {#if $isShowDetail}
<div <div
transition:fly={{ duration: 150 }} transition:fly={{ duration: 150 }}
id="detail-panel" id="detail-panel"
@ -411,7 +411,7 @@
<DetailPanel <DetailPanel
{asset} {asset}
albums={appearsInAlbums} albums={appearsInAlbums}
on:close={() => (isShowDetail = false)} on:close={() => ($isShowDetail = false)}
on:close-viewer={handleCloseViewer} on:close-viewer={handleCloseViewer}
on:description-focus-in={disableKeyDownEvent} on:description-focus-in={disableKeyDownEvent}
on:description-focus-out={enableKeyDownEvent} 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 videoViewerVolume = persisted<number>('video-viewer-volume', 1, {});
export const isShowDetail = persisted<boolean>('info-opened', false, {});
export interface AlbumViewSettings { export interface AlbumViewSettings {
sortBy: string; sortBy: string;
} }