Skip to content

fix(dashboard): fix config copy failing silently in Safari (iOS & macOS)#298

Closed
MatinDehghanian wants to merge 29 commits intoPasarGuard:devfrom
MatinDehghanian:dev-matt
Closed

fix(dashboard): fix config copy failing silently in Safari (iOS & macOS)#298
MatinDehghanian wants to merge 29 commits intoPasarGuard:devfrom
MatinDehghanian:dev-matt

Conversation

@MatinDehghanian
Copy link
Contributor

@MatinDehghanian MatinDehghanian commented Feb 24, 2026

Problem

Copying subscription configs (links, xray, outline, etc.) from the user action buttons appeared to succeed (toast showed "Copied") but nothing was actually written to the clipboard on Safari — both iOS and macOS.

Root cause: Safari requires clipboard.write() / clipboard.writeText() to be called synchronously within a user gesture handler. The previous implementation awaited fetchContent(link) before calling copy(), which yielded the JS event loop and broke Safari's user-gesture requirement, causing the clipboard write to silently fail.

Fix

Use navigator.clipboard.write() with a ClipboardItem that wraps the fetch in a Promise. This initiates the clipboard write synchronously (satisfying Safari's security check) while the content resolves asynchronously. Falls back to the previous writeText approach for browsers without ClipboardItem support (e.g. older Firefox).

Affected file

  • dashboard/src/components/users/action-buttons.tsxhandleLinksCopy

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ImMohammad20000 and others added 28 commits February 24, 2026 22:20
…ization (PasarGuard#299)

* feat(telegram): implement NATS-backed memory storage for FSM synchronization

* refactor: Updated to the aiogram-style implementation
…s and remove related props from advance search modal
…splay to enhance visual clarity and responsiveness
… and enhance error handling for improved reliability
…splay for better readability and responsiveness
…nsure base username with affixes is outside the 3 to 128 character range
@MatinDehghanian MatinDehghanian changed the title feat(dashboard): Use /links_base64 endpoint for QR code config fetching fix(dashboard): fix config copy failing silently in Safari (iOS & macOS) Feb 27, 2026
@ImMohammad20000
Copy link
Contributor

reset to first commit and open another pr for fix(dashboard): use ClipboardItem to fix config copy in Safari commit

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.

4 participants