Added newer spawn paths

This commit is contained in:
CorvusPrudens 2024-08-03 23:44:56 -06:00
parent 08884d75e0
commit bbe4e66648
2 changed files with 2 additions and 3 deletions

View file

@ -75,7 +75,6 @@ mod use_throttle_fn;
mod use_timeout_fn;
mod use_timestamp;
mod use_to_string;
mod use_user_media;
mod use_web_notification;
mod use_websocket;
mod use_window;

View file

@ -79,7 +79,7 @@ pub fn use_clipboard_with_options(
let update_text = move |_| {
if is_supported.get() {
spawn_local(async move {
leptos::spawn::spawn_local(async move {
if let Some(clipboard) = window().navigator().clipboard() {
if let Ok(text) = js_fut!(clipboard.read_text()).await {
set_text.set(text.as_string());
@ -102,7 +102,7 @@ pub fn use_clipboard_with_options(
let start = start.clone();
let value = value.to_owned();
spawn_local(async move {
leptos::spawn::spawn_local(async move {
if let Some(clipboard) = window().navigator().clipboard() {
if js_fut!(clipboard.write_text(&value)).await.is_ok() {
set_text.set(Some(value));