Merge pull request #311 from tidalcycles/fix-clipboard

fix: copy share link to clipboard was broken for some browers
This commit is contained in:
Felix Roos 2022-12-19 20:31:46 +01:00 committed by GitHub
commit 1cabedc65e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,7 +219,7 @@ function App() {
setLastShared(activeCode || code);
const shareUrl = window.location.origin + '?' + hash;
// copy shareUrl to clipboard
navigator.clipboard.writeText(shareUrl);
await navigator.clipboard.writeText(shareUrl);
const message = `Link copied to clipboard: ${shareUrl}`;
alert(message);
// alert(message);