-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fixed rapidly placing multiple pixels #196
feat: fixed rapidly placing multiple pixels #196
Conversation
@Ayoazeez26 is attempting to deploy a commit to the keep-starknet-strange Team on Vercel. A member of the Team first needs to authorize it. |
@@ -183,6 +183,13 @@ const CanvasContainer = (props) => { | |||
}); | |||
|
|||
const pixelClicked = async (e) => { | |||
// Color Extra Pixel | |||
if (props.selectedColorId === -1) { | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is moved to the top, all the other pixel-clicked functionality below doesn't work.
For example, the user cannot select a pixel to get pixel info anymore.
@@ -183,6 +183,13 @@ const CanvasContainer = (props) => { | |||
}); | |||
|
|||
const pixelClicked = async (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution seems to solve the issue because it clears the selected pixel super fast after clicking, so the user doesn't have much time to click again. But, I think it is still possible if the browser is slow / user is fast enough to cause double clicks.
I think using some kind of mutex will be needed to solve the issue since this function can be run asynchronously multiple times. But maybe there is some other crafty way of doing it.
Hey, any update here @Ayoazeez26 |
Hey @b-j-roberts Yes I have, I should be making an update to the PR by tomorrow latest |
@b-j-roberts kindly review these changes, thanks |
Appreciate the PR |
Fixed bug that allows a user to rapidly place extra pixels before the timer starts