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

"Copy Link" not working on mobile #375

Closed
nick-y-ito opened this issue Mar 26, 2024 · 3 comments · Fixed by #378
Closed

"Copy Link" not working on mobile #375

nick-y-ito opened this issue Mar 26, 2024 · 3 comments · Fixed by #378
Assignees
Labels
bug Something isn't working

Comments

@nick-y-ito
Copy link
Member

Description

On some random mobile devices, the "Copy Link" does not copy the URL to the clipboard.

Environment

  • OS:
  • Browser:
  • Device:

Notes

@nick-y-ito nick-y-ito added the bug Something isn't working label Mar 26, 2024
@nick-y-ito nick-y-ito self-assigned this Mar 26, 2024
@nick-y-ito nick-y-ito moved this to 🏗 In progress in Nishiki Mar 26, 2024
@nick-y-ito
Copy link
Member Author

@nick-y-ito
Copy link
Member Author

I commented out the part of the code that sending a request to the backend, and copying linked got successful. Thus, I infer that this issue occurs due to the duration of time after a user clicks the button until navigator.clipboard.writeText() is revoked.

  const handleLinkCopy = async () => {
    setIsLinkButtonClicked(true);
    // const result = await putGenerateInvitationLinkHash(groupId);

    // if (!result.ok) {
    //   alert('Something went wrong. Please try again');
    //   return;
    // }

    // const hash = result.value.invitationLinkHash;
    const hash = "test-hash"
    return await navigator.clipboard.writeText(`${CLIENT_BASE_URL}/groups/join/${hash}`);
  };

@nick-y-ito
Copy link
Member Author

nick-y-ito commented Mar 26, 2024

Also, when clicking a "Copy Link" button, got the following error that occurred on the browser at navigator.clipboard.writeText() before commenting out the above part.

The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

@ShoeheyOt ShoeheyOt linked a pull request Mar 27, 2024 that will close this issue
12 tasks
@nick-y-ito nick-y-ito moved this from 🏗 In progress to 👀 In review in Nishiki Mar 27, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Nishiki Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants