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

Choosing "Share with friends" doesn't reset game counter #19

Open
TisRyno opened this issue Apr 5, 2021 · 0 comments
Open

Choosing "Share with friends" doesn't reset game counter #19

TisRyno opened this issue Apr 5, 2021 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@TisRyno
Copy link
Contributor

TisRyno commented Apr 5, 2021

if (result.isConfirmed) {
setCount(getRandomNumberBetween(300, 1000));
} else if (result.isDenied) {
setCount(getRandomNumberBetween(300, 1000));
} else if (result.isCancelled) {
navigator.clipboard.writeText("https://jewel-jack.netlify.app");
setShow(true);

The setCount(getRandomNumberBetween(300, 1000)); is only run on isConfirmed and isDenied but not isCancelled

I'd suggest just putting

      .then((result) => {
        setCount(getRandomNumberBetween(300, 1000));

        if (result.isCancelled) {
          navigator.clipboard.writeText("https://jewel-jack.netlify.app");
          setShow(true);
          Swal.fire({
            title: "Share",
          });
        }
      })
@zaycation zaycation added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants