Skip to content

Commit

Permalink
use clearShapes instead of setShapes for removing drawables
Browse files Browse the repository at this point in the history
  • Loading branch information
zackschuster committed Jun 25, 2024
1 parent c94a8cc commit 8b11093
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/boards/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function Board({
const storeMakeMove = useStore(store, (s) => s.makeMove);
const setHeaders = useStore(store, (s) => s.setHeaders);
const deleteMove = useStore(store, (s) => s.deleteMove);
const clearShapes = useStore(store, (s) => s.clearShapes);
const setShapes = useStore(store, (s) => s.setShapes);
const setFen = useStore(store, (s) => s.setFen);

Expand Down Expand Up @@ -332,7 +333,7 @@ function Board({
<ActionIcon
variant={editingMode ? "filled" : "default"}
size="lg"
onClick={() => setShapes([])}
onClick={() => clearShapes()}
>
<IconEraser size="1.3rem" />
</ActionIcon>
Expand Down Expand Up @@ -603,7 +604,7 @@ function Board({
className={chessboard}
ref={boardRef}
onClick={() => {
eraseDrawablesOnClick && setShapes([]);
eraseDrawablesOnClick && clearShapes();
}}
onWheel={(e) => {
if (enableBoardScroll) {
Expand Down

0 comments on commit 8b11093

Please sign in to comment.