Fix linting

This commit is contained in:
yangdx 2025-10-02 21:21:33 +08:00
parent d4abe70411
commit b1a4e7d7f0
2 changed files with 6 additions and 6 deletions

View file

@ -43,12 +43,12 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean })
const selectedEdge = useGraphStore.use.selectedEdge() const selectedEdge = useGraphStore.use.selectedEdge()
const focusedEdge = useGraphStore.use.focusedEdge() const focusedEdge = useGraphStore.use.focusedEdge()
const sigmaGraph = useGraphStore.use.sigmaGraph() const sigmaGraph = useGraphStore.use.sigmaGraph()
// Track system theme changes when theme is set to 'system' // 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 window.matchMedia('(prefers-color-scheme: dark)').matches
) )
useEffect(() => { useEffect(() => {
if (theme === 'system') { if (theme === 'system') {
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)') const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
@ -219,7 +219,7 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean })
*/ */
useEffect(() => { useEffect(() => {
// Check if dark mode is actually applied (handles both 'dark' theme and 'system' theme when OS is dark) // 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')) (theme === 'system' && window.document.documentElement.classList.contains('dark'))
const labelColor = isDarkTheme ? Constants.labelColorDarkTheme : undefined const labelColor = isDarkTheme ? Constants.labelColorDarkTheme : undefined
const edgeColor = isDarkTheme ? Constants.edgeColorDarkTheme : undefined const edgeColor = isDarkTheme ? Constants.edgeColorDarkTheme : undefined

View file

@ -56,7 +56,7 @@ const useRandomGraph = () => {
image: faker.image.urlLoremFlickr() image: faker.image.urlLoremFlickr()
}) })
}) })
// Add edge attributes // Add edge attributes
graph.edges().forEach((edge: string) => { graph.edges().forEach((edge: string) => {
graph.mergeEdgeAttributes(edge, { graph.mergeEdgeAttributes(edge, {
@ -65,7 +65,7 @@ const useRandomGraph = () => {
color: randomColor() color: randomColor()
}) })
}) })
return graph as Graph<NodeType, EdgeType> return graph as Graph<NodeType, EdgeType>
}, [faker]) }, [faker])