mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
fix: remove redundant effect dependency
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
eb850a600c
commit
3b2054532c
1 changed files with 1 additions and 4 deletions
|
@ -8,7 +8,6 @@ import { ShowIf } from '../../../components/common/show-if/show-if'
|
||||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||||
import { cypressId } from '../../../utils/cypress-attribute'
|
import { cypressId } from '../../../utils/cypress-attribute'
|
||||||
import { Logger } from '../../../utils/logger'
|
import { Logger } from '../../../utils/logger'
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { Alert } from 'react-bootstrap'
|
import { Alert } from 'react-bootstrap'
|
||||||
import { useAsync } from 'react-use'
|
import { useAsync } from 'react-use'
|
||||||
|
@ -24,8 +23,6 @@ export const GraphvizFrame: React.FC<CodeProps> = ({ code }) => {
|
||||||
const container = useRef<HTMLDivElement>(null)
|
const container = useRef<HTMLDivElement>(null)
|
||||||
const [error, setError] = useState<string>()
|
const [error, setError] = useState<string>()
|
||||||
|
|
||||||
const { basePath } = useRouter()
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
value: graphvizImport,
|
value: graphvizImport,
|
||||||
error: libLoadingError,
|
error: libLoadingError,
|
||||||
|
@ -58,7 +55,7 @@ export const GraphvizFrame: React.FC<CodeProps> = ({ code }) => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showError(error as string)
|
showError(error as string)
|
||||||
}
|
}
|
||||||
}, [code, basePath, showError, graphvizImport])
|
}, [code, showError, graphvizImport])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AsyncLoadingBoundary loading={isLibLoading || !graphvizImport} componentName={'graphviz'} error={libLoadingError}>
|
<AsyncLoadingBoundary loading={isLibLoading || !graphvizImport} componentName={'graphviz'} error={libLoadingError}>
|
||||||
|
|
Loading…
Reference in a new issue