Skip to content

Commit

Permalink
ObjectsAround: quickfix wrong map-keys for coords feature
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz committed Dec 29, 2023
1 parent f6d20e1 commit ed16d57
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/components/FeaturePanel/ObjectsAround.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const AroundItem = ({ feature }: { feature: Feature }) => {
};

// TODO make SSR ?
export const ObjectsAround = ({ advanced }) => {
export const ObjectsAroundInner = ({ advanced }) => {
const { feature } = useFeatureContext();
const { around, loading, error, startAround, finishAround, failAround } =
useLoadingState();
Expand Down Expand Up @@ -135,3 +135,28 @@ export const ObjectsAround = ({ advanced }) => {
</Box>
);
};

/* eslint-disable */

class ErrorBoundary extends React.Component<{}, { hasError: boolean }> {
state = { hasError: false };

static getDerivedStateFromError(error) {
console.log(error);
return { hasError: true };
}

componentDidCatch(error, errorInfo) {
console.log(error, errorInfo);
}

render() {
return this.state.hasError ? <span>error</span> : this.props.children;
}
}

export const ObjectsAround = (props) => (
<ErrorBoundary>
<ObjectsAroundInner {...props} />
</ErrorBoundary>
);

0 comments on commit ed16d57

Please sign in to comment.