fix: eraser cursor showing on theme change when not using eraser (#4990)

This commit is contained in:
David Luzar 2022-04-17 22:47:36 +02:00 committed by GitHub
parent 7431ca81d1
commit a3fbe40b26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1072,7 +1072,10 @@ class App extends React.Component<AppProps, AppState> {
activeTool: { ...this.state.activeTool, type: "selection" }, activeTool: { ...this.state.activeTool, type: "selection" },
}); });
} }
if (prevState.theme !== this.state.theme) { if (
this.state.activeTool.type === "eraser" &&
prevState.theme !== this.state.theme
) {
setEraserCursor(this.canvas, this.state.theme); setEraserCursor(this.canvas, this.state.theme);
} }
// Hide hyperlink popup if shown when element type is not selection // Hide hyperlink popup if shown when element type is not selection