mobile download
This commit is contained in:
@@ -1,20 +1,14 @@
|
||||
export type StrategyCanvasInteractionMode = 'pan' | 'select';
|
||||
import { getUiPreferences, patchUiPreferences } from './uiPreferencesDb';
|
||||
|
||||
const STORAGE_KEY = 'gc_se_canvas_interaction';
|
||||
export type CanvasInteractionMode = 'pan' | 'select';
|
||||
/** @deprecated CanvasInteractionMode */
|
||||
export type StrategyCanvasInteractionMode = CanvasInteractionMode;
|
||||
|
||||
export function loadCanvasInteractionMode(): StrategyCanvasInteractionMode {
|
||||
try {
|
||||
const raw = localStorage.getItem(STORAGE_KEY);
|
||||
return raw === 'pan' ? 'pan' : 'select';
|
||||
} catch {
|
||||
return 'select';
|
||||
}
|
||||
export function loadCanvasInteractionMode(): CanvasInteractionMode {
|
||||
const mode = getUiPreferences().strategyEditor?.canvasInteraction;
|
||||
return mode === 'pan' ? 'pan' : 'select';
|
||||
}
|
||||
|
||||
export function saveCanvasInteractionMode(mode: StrategyCanvasInteractionMode): void {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, mode);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
export function saveCanvasInteractionMode(mode: CanvasInteractionMode): void {
|
||||
patchUiPreferences({ strategyEditor: { canvasInteraction: mode } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user