mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: asset viewer (#25059)
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { PersistedLocalStorage } from '$lib/utils/persisted';
|
||||
|
||||
const isShowDetailPanel = new PersistedLocalStorage<boolean>('asset-viewer-state', false);
|
||||
|
||||
export class AssetViewerManager {
|
||||
#isShowActivityPanel = $state(false);
|
||||
|
||||
get isShowActivityPanel() {
|
||||
return this.#isShowActivityPanel;
|
||||
}
|
||||
|
||||
private set isShowActivityPanel(value: boolean) {
|
||||
this.#isShowActivityPanel = value;
|
||||
}
|
||||
|
||||
get isShowDetailPanel() {
|
||||
return isShowDetailPanel.current;
|
||||
}
|
||||
|
||||
private set isShowDetailPanel(value: boolean) {
|
||||
isShowDetailPanel.current = value;
|
||||
}
|
||||
|
||||
toggleActivityPanel() {
|
||||
this.closeDetailPanel();
|
||||
this.isShowActivityPanel = !this.isShowActivityPanel;
|
||||
}
|
||||
|
||||
closeActivityPanel() {
|
||||
this.isShowActivityPanel = false;
|
||||
}
|
||||
|
||||
toggleDetailPanel() {
|
||||
this.closeActivityPanel();
|
||||
this.isShowDetailPanel = !this.isShowDetailPanel;
|
||||
}
|
||||
|
||||
closeDetailPanel() {
|
||||
this.isShowDetailPanel = false;
|
||||
}
|
||||
}
|
||||
|
||||
export const assetViewerManager = new AssetViewerManager();
|
||||
Reference in New Issue
Block a user