Skip to content
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

Merged

Conversation

Ayoazeez26
Copy link
Contributor

Fixed bug that allows a user to rapidly place extra pixels before the timer starts

Copy link

vercel bot commented May 28, 2024

@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;
Copy link
Contributor

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) => {
Copy link
Contributor

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.

@b-j-roberts
Copy link
Contributor

Hey, any update here @Ayoazeez26
Have you had a chance to resolve my comments?

@Ayoazeez26
Copy link
Contributor Author

Hey @b-j-roberts Yes I have, I should be making an update to the PR by tomorrow latest

@Ayoazeez26
Copy link
Contributor Author

@b-j-roberts kindly review these changes, thanks

@b-j-roberts b-j-roberts merged commit d6833e4 into keep-starknet-strange:main Jun 10, 2024
3 of 4 checks passed
@b-j-roberts
Copy link
Contributor

Appreciate the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants