mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-06 12:18:48 +00:00
place error boundaries closer to the source
This commit is contained in:
parent
88c774339d
commit
ea96999377
6 changed files with 31 additions and 21 deletions
|
@ -1,5 +1,6 @@
|
|||
import { useTranslation } from "next-i18next";
|
||||
|
||||
import ErrorBoundary from "components/errorboundry";
|
||||
import components from "widgets/components";
|
||||
|
||||
export default function Widget({ service }) {
|
||||
|
@ -8,7 +9,11 @@ export default function Widget({ service }) {
|
|||
const ServiceWidget = components[service.widget.type];
|
||||
|
||||
if (ServiceWidget) {
|
||||
return <ServiceWidget service={service} />;
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<ServiceWidget service={service} />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue