Skip to content

Commit

Permalink
chore(web): fix default infobox behavior (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 authored Sep 13, 2023
1 parent ba4409c commit a364159
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions web/src/beta/lib/core/Visualizer/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@ export default function useHooks(
const defaultInfobox = selectedLayer.reason?.defaultInfobox;
const infobox = useMemo(
() =>
selectedLayer
selectedLayer.layer?.layer?.infobox
? {
title: selectedLayer.layer?.layer?.title || defaultInfobox?.title,
isEditable: !!selectedLayer.layer?.layer?.infobox,
visible: !!selectedLayer.layer?.layer?.infobox || !!defaultInfobox,
property: selectedLayer.layer?.layer?.infobox?.property?.default,
blocks: blocks?.length ? blocks : defaultInfoboxBlocks(defaultInfobox),
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/beta/lib/core/Visualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const Visualizer: FC<PropsWithChildren<Props>> = memo(
selectedReason={selectedLayer.reason}
infoboxProperty={infobox?.property}
infoboxTitle={infobox?.title}
infoboxVisible={!!infobox?.visible}
infoboxVisible={!!infobox}
selectedBlockId={selectedBlock}
selectedLayerId={selectedLayerIdForCrust}
widgetAlignSystem={widgetAlignSystem}
Expand Down

0 comments on commit a364159

Please sign in to comment.