chore: Add error boundary around document notices

This commit is contained in:
Tom Moor
2024-02-01 18:03:59 -05:00
parent 554c3a87dc
commit f6e6187ff5

View File

@@ -4,6 +4,7 @@ import * as React from "react";
import { Trans, useTranslation } from "react-i18next";
import styled from "styled-components";
import Document from "~/models/Document";
import ErrorBoundary from "~/components/ErrorBoundary";
import Notice from "~/components/Notice";
import Time from "~/components/Time";
@@ -47,7 +48,7 @@ export default function Notices({ document, readOnly }: Props) {
}
return (
<>
<ErrorBoundary>
{document.isTemplate && !readOnly && (
<Notice
icon={<ShapesIcon />}
@@ -82,7 +83,7 @@ export default function Notices({ document, readOnly }: Props) {
<Time dateTime={document.deletedAt} addSuffix />
</Notice>
)}
</>
</ErrorBoundary>
);
}