mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
feat(web): persist state of file path information in details panel (#27770)
feat(enhancement): persist state of file path info in details panel
This commit is contained in:
@@ -9,6 +9,7 @@ import type { ZoomImageWheelState } from '@zoom-image/core';
|
||||
import { cubicOut } from 'svelte/easing';
|
||||
|
||||
const isShowDetailPanel = new PersistedLocalStorage<boolean>('asset-viewer-state', false);
|
||||
const isShowAssetPath = new PersistedLocalStorage<boolean>('asset-viewer-show-path', false);
|
||||
|
||||
const createDefaultZoomState = (): ZoomImageWheelState => ({
|
||||
currentRotation: 0,
|
||||
@@ -63,6 +64,10 @@ class AssetViewerManager extends BaseEventManager<Events> {
|
||||
return isShowDetailPanel.current;
|
||||
}
|
||||
|
||||
get isShowAssetPath() {
|
||||
return isShowAssetPath.current;
|
||||
}
|
||||
|
||||
get isFaceEditMode() {
|
||||
return this.#isFaceEditMode;
|
||||
}
|
||||
@@ -101,6 +106,10 @@ class AssetViewerManager extends BaseEventManager<Events> {
|
||||
isShowDetailPanel.current = value;
|
||||
}
|
||||
|
||||
private set isShowAssetPath(value: boolean) {
|
||||
isShowAssetPath.current = value;
|
||||
}
|
||||
|
||||
onZoomChange(state: ZoomImageWheelState) {
|
||||
// bypass event emitter to avoid loop
|
||||
this.#zoomState = state;
|
||||
@@ -147,6 +156,10 @@ class AssetViewerManager extends BaseEventManager<Events> {
|
||||
this.isShowActivityPanel = false;
|
||||
}
|
||||
|
||||
toggleAssetPath() {
|
||||
this.isShowAssetPath = !this.isShowAssetPath;
|
||||
}
|
||||
|
||||
toggleDetailPanel() {
|
||||
this.closeActivityPanel();
|
||||
this.isShowDetailPanel = !this.isShowDetailPanel;
|
||||
|
||||
Reference in New Issue
Block a user