From 8c9b89a8b659ba5be2b1dbd3b6a576f687168995 Mon Sep 17 00:00:00 2001 From: no-materials Date: Sun, 18 Aug 2024 10:50:28 +0200 Subject: [PATCH] Adapt to `web-sys` clipboard api change (#301) --- src/web_clipboard.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/web_clipboard.rs b/src/web_clipboard.rs index c335e874e..34bef83ed 100644 --- a/src/web_clipboard.rs +++ b/src/web_clipboard.rs @@ -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 {