File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { Tool, tools } from "./data";
1212
1313const ToolBar = ( ) => {
1414 const selectedTool = useSelector ( ( state ) => state . toolbar . selectedTool ) ;
15+ const selectedPolylineId = store . getState ( ) . editor . selectedPolylineId ;
1516
1617 const onEscape = useCallback (
1718 ( event ) => {
@@ -49,6 +50,9 @@ const ToolBar = () => {
4950 store . dispatch ( showControls ( ) ) ;
5051 if ( tool === Tool . Shape ) selectFirstShape ( ) ;
5152 }
53+ if ( tool !== Tool . Pen && selectedPolylineId ) {
54+ store . dispatch ( setSelectedPolylineId ( null ) ) ;
55+ }
5256 } ;
5357
5458 return (
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717 addText ,
1818 deleteBooth ,
1919 deleteImage ,
20+ deletePolyline ,
2021 deleteSeat ,
2122 deleteShape ,
2223 deleteText ,
@@ -94,6 +95,8 @@ const useWorkspaceClick = () => {
9495 store . dispatch ( deleteText ( e . target . id ) ) ;
9596 } else if ( e . target . nodeName === "image" ) {
9697 store . dispatch ( deleteImage ( e . target . id ) ) ;
98+ } else if ( e . target . nodeName === "polyline" ) {
99+ store . dispatch ( deletePolyline ( e . target . id ) ) ;
97100 }
98101 }
99102 } ;
You can’t perform that action at this time.
0 commit comments