diff --git a/gui/frontend/src/components/molecules/JsAutoRunButton/JsAutoRunButton.tsx b/gui/frontend/src/components/molecules/JsAutoRunButton/JsAutoRunButton.tsx index 0994694..ae123db 100644 --- a/gui/frontend/src/components/molecules/JsAutoRunButton/JsAutoRunButton.tsx +++ b/gui/frontend/src/components/molecules/JsAutoRunButton/JsAutoRunButton.tsx @@ -3,15 +3,15 @@ import { Checkbox, FormControlLabel, Tooltip } from '@mui/material'; import { useStorageState } from '@/components/hooks/useStorageState/useStorageState'; import { useTranslation } from '@/components/hooks/useTranslation'; +import { HIDDEN_CACHE_OBJ } from '@/lib/storage/cacheKeys'; import type { FormControlLabelProps } from '@mui/material'; type Props = Omit; -const CACHE_KEY = 'run-script'; export const JsAutoRunButton = ({ ...props }: Props) => { const { t } = useTranslation(); - const [runScript, setRunScript] = useStorageState(CACHE_KEY, false); + const [runScript, setRunScript] = useStorageState(HIDDEN_CACHE_OBJ.runScript, false); const title = ( <> @@ -33,7 +33,7 @@ export const JsAutoRunButton = ({ ...props }: Props) => { return ( } + control={} label={label} {...props} /> diff --git a/gui/frontend/src/components/organisms/CodeEditor/CodeEditor.tsx b/gui/frontend/src/components/organisms/CodeEditor/CodeEditor.tsx index e0959d0..cb51a79 100644 --- a/gui/frontend/src/components/organisms/CodeEditor/CodeEditor.tsx +++ b/gui/frontend/src/components/organisms/CodeEditor/CodeEditor.tsx @@ -6,6 +6,7 @@ import { useTranslation } from '@/components/hooks/useTranslation'; import { useCssContext } from '@/components/providers/CssProvider'; import { useJsContext } from '@/components/providers/JsProvider'; import { CSS } from '@/lib/css'; +import { PUB_CACHE_OBJ } from '@/lib/storage/cacheKeys'; import { type EditorInfo, EditorInitializer } from './EditorInitializer'; @@ -14,7 +15,7 @@ export const CodeEditor = () => { const { css, setCss, setPreset } = useCssContext(); const { t } = useTranslation(); - const [value, setValue] = useStorageState<'javascript' | 'css'>('editor-tab-select', 'javascript'); + const [value, setValue] = useStorageState<'javascript' | 'css'>(PUB_CACHE_OBJ.editorTabSelect, 'javascript'); const handleTabChange: TabListProps['onChange'] = (_event, newValue) => { setValue(newValue); };