Skip to content

Commit

Permalink
images: fix og-image without featureContext + api call (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz authored Sep 2, 2024
1 parent bc900e1 commit 5eefa4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/FeaturePanel/ImagePane/PathsSvg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type PathsProps = {
size: Size;
};
export const Paths = ({ def, feature, size }: PathsProps) => {
const { preview } = useFeatureContext();
const { preview } = useFeatureContext() ?? {};

return (
isTag(def) && (
Expand Down
3 changes: 2 additions & 1 deletion src/services/osmApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ const getMemberFeatures = (members: Feature['members'], map) => {

export const fetchWithMemberFeatures = async (apiId: OsmId) => {
if (apiId.type !== 'relation') {
const wayOrNode = await fetchJson(getOsmUrl(apiId));
const wayOrNodeResponse = await fetchJson(getOsmUrl(apiId));
const wayOrNode = wayOrNodeResponse.elements[0];
return addSchemaToFeature(osmToFeature(wayOrNode));
}

Expand Down

0 comments on commit 5eefa4e

Please sign in to comment.