mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
13 lines
455 B
TypeScript
13 lines
455 B
TypeScript
|
import useEventListener from '@/shared/hooks/use-event-listener'
|
||
|
import { useLocalCompileContext } from '@/shared/context/local-compile-context'
|
||
|
|
||
|
export function useHasLintingError() {
|
||
|
const { setHasLintingError } = useLocalCompileContext()
|
||
|
|
||
|
// Listen for editor:lint event from CM6 linter and keep compile context
|
||
|
// up to date
|
||
|
useEventListener('editor:lint', (event: CustomEvent) => {
|
||
|
setHasLintingError(event.detail.hasLintingError)
|
||
|
})
|
||
|
}
|