diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 8d46984928..d14a78b05a 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -4679,11 +4679,6 @@ "count": 12 } }, - "web/app/components/workflow/panel/debug-and-preview/index.tsx": { - "no-restricted-globals": { - "count": 1 - } - }, "web/app/components/workflow/panel/env-panel/variable-modal.tsx": { "no-restricted-imports": { "count": 1 diff --git a/web/app/components/workflow/panel/debug-and-preview/index.tsx b/web/app/components/workflow/panel/debug-and-preview/index.tsx index 4aefec71d5..6e246df9e1 100644 --- a/web/app/components/workflow/panel/debug-and-preview/index.tsx +++ b/web/app/components/workflow/panel/debug-and-preview/index.tsx @@ -19,6 +19,7 @@ import { RefreshCcw01 } from '@/app/components/base/icons/src/vender/line/arrows import { useEdgesInteractionsWithoutSync } from '@/app/components/workflow/hooks/use-edges-interactions-without-sync' import { useNodesInteractionsWithoutSync } from '@/app/components/workflow/hooks/use-nodes-interactions-without-sync' import { useStore } from '@/app/components/workflow/store' +import { useSetLocalStorage } from '@/hooks/use-local-storage' import { useWorkflowInteractions, } from '../../hooks' @@ -54,11 +55,12 @@ const DebugAndPreview = () => { const nodePanelWidth = useStore(s => s.nodePanelWidth) const panelWidth = useStore(s => s.previewPanelWidth) const setPanelWidth = useStore(s => s.setPreviewPanelWidth) + const setPanelWidthStorage = useSetLocalStorage('debug-and-preview-panel-width', { raw: true }) const handleResize = useCallback((width: number, source: 'user' | 'system' = 'user') => { if (source === 'user') - localStorage.setItem('debug-and-preview-panel-width', `${width}`) + setPanelWidthStorage(`${width}`) setPanelWidth(width) - }, [setPanelWidth]) + }, [setPanelWidth, setPanelWidthStorage]) const maxPanelWidth = useMemo(() => { if (!workflowCanvasWidth) return 720