-
-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update web-sys and js-sys #17556
Conversation
@@ -354,11 +354,7 @@ impl RuffleHandle { | |||
|
|||
async fn run_context_menu_callback_paste(&self, index: usize) { | |||
let window = web_sys::window().expect("Missing window"); | |||
let Some(clipboard) = window.navigator().clipboard() else { | |||
tracing::warn!("Clipboard unsupported"); | |||
let _ = self.with_instance(|inst| inst.js_player.display_clipboard_modal(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is display_clipboard_modal
still called with false
anywhere? If not, I suppose it can be simplified by removing its parameter. Doesn't have to be in this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I think it's unused now.
I was actually wondering if we should somehow manually (probably something like "clipboard" in navigator
) keep checking if clipboard
exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I was wondering - since accessing it no longer returns an Option
, what happens if it's not available anyway? A JS exception? Errors on use? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an explicit check for "clipboard" in navigator
, because otherwise the navigator.clipboard()
just panics when the property doesn't exist.
Relevant changelog entry: https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md#0293 |
9bbf2e5
to
ff6c793
Compare
cargo clippy complains
|
fixed it for you |
ff6c793
to
172db95
Compare
Oh, |
No description provided.