Skip to content

Handle clipboard failures in SocialInteractions share button - #1112

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
lamborghini21:fix/clipboard-failure-handling-1041
Jul 30, 2026
Merged

Handle clipboard failures in SocialInteractions share button#1112
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
lamborghini21:fix/clipboard-failure-handling-1041

Conversation

@lamborghini21

Copy link
Copy Markdown
Contributor

Description

navigator.clipboard.writeText in handleShare (SocialInteractions.tsx, lines 20-25) was awaited without a try/catch. In an insecure context (non-HTTPS) or when clipboard permission is denied, the promise rejects unhandled and the "Copied!" confirmation never appears, leaving the user with no feedback that the copy failed.

Wrapped the clipboard write in try/catch and added a copyError state. On failure, the button now shows "Failed to copy" instead of silently doing nothing. Both the success and error messages auto-clear after 2 seconds.

Related Issue

Closes #1041

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • Uses Lucide icons consistently
  • Responsive design implemented
  • Starknet best practices followed

Wrap navigator.clipboard.writeText in try/catch to handle insecure contexts and permission denials. Add error state to surface a 'Failed to copy' message to users when clipboard operations fail.

Fixes rinafcode#1041
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@lamborghini21 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit c06a4b5 into rinafcode:main Jul 30, 2026
6 checks passed
@lamborghini21
lamborghini21 deleted the fix/clipboard-failure-handling-1041 branch July 30, 2026 12:28
@lamborghini21

Copy link
Copy Markdown
Contributor Author

Thank you for contributing to the project.

Thank you for always.

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.

Handle clipboard failures in the SocialInteractions share button

2 participants