This commit is contained in:
Evan Almloff authored and GitHub committed 2024-10-01 10:25:31 -05:00
1 parent 95976d9a17
commit f9c2f740c2
4 files changed
+15 -28

No files matched your search

+4 -6
View File
@@ -5,7 +5,7 @@ use crate::{
ShortcutHandle, ShortcutRegistryError, WryEventHandler,
};
use dioxus_core::{
prelude::{consume_context, current_scope_id, use_hook_with_cleanup, RuntimeGuard},
prelude::{consume_context, use_hook_with_cleanup, RuntimeGuard},
use_hook, Runtime,
};
@@ -69,11 +69,9 @@ pub fn use_asset_handler(
use_hook_with_cleanup(
|| {
crate::window().asset_handlers.register_handler(
name.to_string(),
Box::new(move |asset, responder| cb((asset, responder))),
current_scope_id().unwrap(),
);
crate::window()
.asset_handlers
.register_handler(name.to_string(), cb);
Rc::new(name.to_string())
},