From b1a4e7d7f0eec7c773927199b7e99b094dd452c9 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 2 Oct 2025 21:21:33 +0800 Subject: [PATCH] Fix linting --- lightrag_webui/src/components/graph/GraphControl.tsx | 8 ++++---- lightrag_webui/src/hooks/useRandomGraph.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lightrag_webui/src/components/graph/GraphControl.tsx b/lightrag_webui/src/components/graph/GraphControl.tsx index 6d040c47..55864789 100644 --- a/lightrag_webui/src/components/graph/GraphControl.tsx +++ b/lightrag_webui/src/components/graph/GraphControl.tsx @@ -43,12 +43,12 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean }) const selectedEdge = useGraphStore.use.selectedEdge() const focusedEdge = useGraphStore.use.focusedEdge() const sigmaGraph = useGraphStore.use.sigmaGraph() - + // Track system theme changes when theme is set to 'system' - const [systemThemeIsDark, setSystemThemeIsDark] = useState(() => + const [systemThemeIsDark, setSystemThemeIsDark] = useState(() => window.matchMedia('(prefers-color-scheme: dark)').matches ) - + useEffect(() => { if (theme === 'system') { const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)') @@ -219,7 +219,7 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean }) */ useEffect(() => { // Check if dark mode is actually applied (handles both 'dark' theme and 'system' theme when OS is dark) - const isDarkTheme = theme === 'dark' || + const isDarkTheme = theme === 'dark' || (theme === 'system' && window.document.documentElement.classList.contains('dark')) const labelColor = isDarkTheme ? Constants.labelColorDarkTheme : undefined const edgeColor = isDarkTheme ? Constants.edgeColorDarkTheme : undefined diff --git a/lightrag_webui/src/hooks/useRandomGraph.tsx b/lightrag_webui/src/hooks/useRandomGraph.tsx index 6bc0a1a2..2337ccd7 100644 --- a/lightrag_webui/src/hooks/useRandomGraph.tsx +++ b/lightrag_webui/src/hooks/useRandomGraph.tsx @@ -56,7 +56,7 @@ const useRandomGraph = () => { image: faker.image.urlLoremFlickr() }) }) - + // Add edge attributes graph.edges().forEach((edge: string) => { graph.mergeEdgeAttributes(edge, { @@ -65,7 +65,7 @@ const useRandomGraph = () => { color: randomColor() }) }) - + return graph as Graph }, [faker])