Skip to content

Commit

Permalink
fix: fix copy issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 5, 2024
1 parent 6e1d6aa commit fbe6a61
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions www/src/pages/IconDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,14 @@ export const IconDetailPage = () => {
evn.preventDefault();
if (window.isSecureContext) {
// @ts-ignore
navigator.clipboard.writeText(svgString!)
navigator.clipboard.writeText(svgString!).then(() => {
toast.success(<div>Copied '<b>{filename}</b>' icon HTML code to clipboard</div>, { position: 'top-right' });
})
} else {
copyTextToClipboard(svgString!, () => {
toast.success(<div>Copied '<b>{filename}</b>' icon HTML code to clipboard</div>, { position: 'top-right' });
});
}
copyTextToClipboard(svgString!, () => {
toast.success(<div>Copied '<b>{filename}</b>' icon HTML code to clipboard</div>, { position: 'top-right' });
});
return false
}
const repoInfo = info[params.name!] || {}
Expand Down

0 comments on commit fbe6a61

Please sign in to comment.