From 4074e2ca68a351f508a0e358d41205cc809dcc78 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 23 Feb 2025 17:58:15 +0200 Subject: [PATCH] web/modal: add error boundary for content --- web/src/ui/modal/Modal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/ui/modal/Modal.tsx b/web/src/ui/modal/Modal.tsx index 668a266..9574e2e 100644 --- a/web/src/ui/modal/Modal.tsx +++ b/web/src/ui/modal/Modal.tsx @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import React, { Context, JSX, useCallback, useEffect, useLayoutEffect, useReducer, useRef } from "react" +import ErrorBoundary from "../util/ErrorBoundary.tsx" import { ModalCloseContext, ModalState, openModal } from "./contexts.ts" interface ModalWrapperProps { @@ -71,7 +72,11 @@ const ModalWrapper = ({ children, ContextType, historyStateKey }: ModalWrapperPr }, [historyStateKey, onClickWrapper]) let modal: JSX.Element | null = null if (state) { - let content = {state.content} + let content = + + {state.content} + + if (state.boxed) { content =