Skip to content

Commit

Permalink
Adapt to web-sys clipboard api change (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
no-materials authored Aug 18, 2024
1 parent 9b9894d commit 8c9b89a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/web_clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,7 @@ fn clipboard_copy(contents: String) {
return;
};

let nav = window.navigator();
let Some(clipboard) = nav.clipboard() else {
log::warn!("Failed to access clipboard");
return;
};
let clipboard = window.navigator().clipboard();

let promise = clipboard.write_text(&contents);
if let Err(err) = wasm_bindgen_futures::JsFuture::from(promise).await {
Expand Down

0 comments on commit 8c9b89a

Please sign in to comment.