Fix linting

This commit is contained in:
yangdx
2025-03-14 00:03:45 +08:00
parent 1a92d46bff
commit 55d796c669
13 changed files with 167 additions and 167 deletions

View File

@@ -8,20 +8,20 @@ export default function ApiSite() {
const { isTabVisible } = useTabVisibility()
const isApiTabVisible = isTabVisible('api')
const [iframeLoaded, setIframeLoaded] = useState(false)
// Load the iframe once on component mount
useEffect(() => {
if (!iframeLoaded) {
setIframeLoaded(true)
}
}, [iframeLoaded])
// Use CSS to hide content when tab is not visible
return (
<div className={`size-full ${isApiTabVisible ? '' : 'hidden'}`}>
{iframeLoaded ? (
<iframe
src={backendBaseUrl + '/docs'}
<iframe
src={backendBaseUrl + '/docs'}
className="size-full w-full h-full"
style={{ width: '100%', height: '100%', border: 'none' }}
// Use key to ensure iframe doesn't reload

View File

@@ -76,7 +76,7 @@ export default function DocumentManager() {
if (!isDocumentsTabVisible || !health) {
return
}
const interval = setInterval(async () => {
try {
await fetchDocuments()
@@ -84,7 +84,7 @@ export default function DocumentManager() {
toast.error(t('documentPanel.documentManager.errors.scanProgressFailed', { error: errorMessage(err) }))
}
}, 5000)
return () => clearInterval(interval)
}, [health, fetchDocuments, t, isDocumentsTabVisible])

View File

@@ -115,7 +115,7 @@ const GraphViewer = () => {
const moveToSelectedNode = useGraphStore.use.moveToSelectedNode()
const isFetching = useGraphStore.use.isFetching()
const shouldRender = useGraphStore.use.shouldRender() // Rendering control state
// Get tab visibility
const { isTabVisible } = useTabVisibility()
const isGraphTabVisible = isTabVisible('knowledge-graph')
@@ -137,7 +137,7 @@ const GraphViewer = () => {
initAttemptedRef.current = true
console.log('Graph viewer initialized')
}
// Cleanup function when component unmounts
return () => {
// Only log cleanup, don't actually clean up the WebGL context