Fix linting
This commit is contained in:
@@ -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
|
||||
|
@@ -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])
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user