Skip to content

Commit

Permalink
Swap onClick for onSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Oct 15, 2024
1 parent 378da62 commit 3ee9595
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/app/components/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export const MapContextMenu: React.FC = () => {
const contextMenu = useMapStore((state) => state.contextMenu);
const handleShatter = useMapStore((state) => state.handleShatter);
if (!contextMenu) return null;
const onClick = () => {

const handleSelect = () => {
if (!mapDocument || contextMenu?.data?.id === undefined) return;
handleShatter(mapDocument.document_id, [contextMenu.data.id.toString()]);
contextMenu.close();
Expand Down Expand Up @@ -40,7 +41,7 @@ export const MapContextMenu: React.FC = () => {
)}
<ContextMenu.Item
disabled={!mapDocument?.child_layer}
onClick={onClick}
onSelect={handleSelect}
>
Shatter
</ContextMenu.Item>
Expand Down

0 comments on commit 3ee9595

Please sign in to comment.