Handle message render errors in timeline

This commit is contained in:
Fedor Indutny 2021-08-02 13:55:47 -07:00 committed by GitHub
parent 1891375c6c
commit 907e1d32ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 176 additions and 1 deletions

View file

@ -21,6 +21,7 @@ import { assert } from '../../util/assert';
import { missingCaseError } from '../../util/missingCaseError';
import { PropsActions as MessageActionsType } from './Message';
import { ErrorBoundary } from './ErrorBoundary';
import { PropsActions as SafetyNumberActionsType } from './SafetyNumberNotification';
import { Intl } from '../Intl';
import { TimelineWarning } from './TimelineWarning';
@ -653,6 +654,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
}: RowRendererParamsType): JSX.Element => {
const {
id,
i18n,
haveOldest,
items,
renderItem,
@ -727,7 +729,9 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
style={styleWithWidth}
role="row"
>
{renderItem(messageId, id, this.resizeMessage, this.props)}
<ErrorBoundary i18n={i18n} showDebugLog={() => window.showDebugLog()}>
{renderItem(messageId, id, this.resizeMessage, this.props)}
</ErrorBoundary>
</div>
);
}