Skip to content

Commit

Permalink
fix: wrong oneline key output copy (#13)
Browse files Browse the repository at this point in the history
This PR addresses issue where the oneline toggle is enabled, and a user
clicks on the `Copy` button yet Multi-line output key is copied
regardless.

### Related Issue

Fixes #10

🔑
  • Loading branch information
babblebey authored Aug 1, 2024
1 parent 97ecf85 commit e109e39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ export default function Home() {
type="button"
className="relative inline-flex items-center px-4 py-2 -ml-px space-x-2 text-sm font-medium duration-150 border rounded text-zinc-700 border-zinc-300 bg-zinc-50 hover focus:border-zinc-500 focus:outline-none hover:text-zinc-50 hover:bg-zinc-900"
onClick={() => {
navigator.clipboard.writeText(outputKey);
navigator.clipboard.writeText(
oneline
? outputKey?.replace(/\n/g, "\\n")
: outputKey
);
setCopied(true);
}}
>
Expand Down

0 comments on commit e109e39

Please sign in to comment.