Skip to content

Commit

Permalink
Make edit button active whenever there's a dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoldowsky committed Mar 13, 2024
1 parent fd793f4 commit 9828047
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/plugins/graph/components/graph-toolbar-registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ const SelectPointsButton = observer(function({name}: IToolbarButtonComponentProp
const graph = useGraphModelContext();
const currentMode = graph.editingMode;

const editableLayers = graph.getEditableLayers();
const hasEditableLayers = editableLayers.length > 0;
const linked = graph.isLinkedToDataSet;

function handleClick() {
graph.setEditingMode(currentMode==="edit" ? "none" : "edit");
Expand All @@ -136,7 +135,7 @@ const SelectPointsButton = observer(function({name}: IToolbarButtonComponentProp
title="Select/Move point"
onClick={handleClick}
selected={currentMode === "edit"}
disabled={!hasEditableLayers}
disabled={!linked}
>
<SelectToolIcon/>
</TileToolbarButton>
Expand Down

0 comments on commit 9828047

Please sign in to comment.