/
alt3rmann
/
label-studio
Обзор
Документация
Войти
/
alt3rmann
/
label-studio
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
web/apps/labelstudio/src/components/Error/InlineError.jsx
19 строк
619 B
bmartel
feat: OPTIC-1746: Improve global error message handling by showing toast messages in favour of modals with increased Sentry reporting (#7167)
11 мар 2025, 19:49
Не верифицирован
11 мар 2025, 19:49
f870a50
Код
Авторство
О чём код?
import React from "react"; import { ApiContext } from "../../providers/ApiProvider"; import { Block } from "../../utils/bem"; import { ErrorWrapper } from "./Error"; export const InlineError = ({ children, includeValidation, className, style }) => { const context = React.useContext(ApiContext); React.useEffect(() => { context.showGlobalError = false; }, [context]); return context.error ? ( <Block name="inline-error" mix={className} style={style}> <ErrorWrapper possum={false} {...context.errorFormatter(context.error, { includeValidation })} /> {children} </Block> ) : null; };