diff --git a/frontend/src/app.rs b/frontend/src/app.rs index f9d8b7e..8b73e5d 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -9,6 +9,7 @@ use leptos::logging; use leptos::task::spawn_local; use leptos_router::components::{Router, Routes, Route}; use leptos_router::hooks::use_navigate; +// use leptos_router::PossibleRouteMatch; // Bu trait prelude ile gelmeli veya public olmayabilir. #[component] pub fn App() -> impl IntoView { diff --git a/frontend/src/components/context_menu.rs b/frontend/src/components/context_menu.rs index 98db3ef..2bf0be6 100644 --- a/frontend/src/components/context_menu.rs +++ b/frontend/src/components/context_menu.rs @@ -14,15 +14,15 @@ pub fn ContextMenu( ) -> impl IntoView { let container_ref = create_node_ref::(); - let _ = on_click_outside(container_ref, move |_| on_close.call(())); + let _ = on_click_outside(container_ref, move |_| on_close.run(())); let handle_action = move |action: &str| { let hash = torrent_hash.clone(); let action_str = action.to_string(); logging::log!("ContextMenu: Action '{}' for hash '{}'", action_str, hash); - on_action.call((action_str, hash)); // Delegate FIRST - on_close.call(()); // Close menu AFTER + on_action.run((action_str, hash)); // Delegate FIRST + on_close.run(()); // Close menu AFTER }; if !visible { diff --git a/frontend/src/components/layout/statusbar.rs b/frontend/src/components/layout/statusbar.rs index a59add9..df6934b 100644 --- a/frontend/src/components/layout/statusbar.rs +++ b/frontend/src/components/layout/statusbar.rs @@ -5,6 +5,7 @@ use leptos::task::spawn_local; use leptos_use::storage::use_local_storage; use ::codee::string::FromToStringCodec; use shared::GlobalLimitRequest; +use reactive_graph::traits::{Get, Set, GetUntracked}; use crate::api; fn format_bytes(bytes: i64) -> String { diff --git a/frontend/src/components/modal.rs b/frontend/src/components/modal.rs index 78f1ae8..8da4190 100644 --- a/frontend/src/components/modal.rs +++ b/frontend/src/components/modal.rs @@ -14,13 +14,13 @@ pub fn Modal( #[prop(into, default = "Cancel".to_string())] cancel_text: String, #[prop(into, default = false)] is_danger: bool, ) -> impl IntoView { - let title = store_value(title); + let title = StoredValue::new_local(title); // Eagerly render children to a Fragment, which is Clone - let child_view = store_value(children()); - let on_confirm = store_value(on_confirm); - let on_cancel = store_value(on_cancel); - let confirm_text = store_value(confirm_text); - let cancel_text = store_value(cancel_text); + let child_view = StoredValue::new_local(children()); + let on_confirm = StoredValue::new_local(on_confirm); + let on_cancel = StoredValue::new_local(on_cancel); + let confirm_text = StoredValue::new_local(confirm_text); + let cancel_text = StoredValue::new_local(cancel_text); view! { @@ -35,7 +35,7 @@ pub fn Modal(
@@ -46,7 +46,7 @@ pub fn Modal( )) on:click=move |_| { logging::log!("Modal: Confirm clicked"); - on_confirm.with_value(|cb| cb.call(())) + on_confirm.with_value(|cb| cb.run(())) } > {confirm_text.get_value()} diff --git a/frontend/src/components/torrent/add_torrent.rs b/frontend/src/components/torrent/add_torrent.rs index 2b2571e..5d757e7 100644 --- a/frontend/src/components/torrent/add_torrent.rs +++ b/frontend/src/components/torrent/add_torrent.rs @@ -48,7 +48,7 @@ pub fn AddTorrentModal( if let Some(dialog) = dialog_ref.get() { dialog.close(); } - on_close.call(()); + on_close.run(()); } Err(e) => { logging::error!("Failed to add torrent: {:?}", e); @@ -64,7 +64,7 @@ pub fn AddTorrentModal( if let Some(dialog) = dialog_ref.get() { dialog.close(); } - on_close.call(()); + on_close.run(()); }; view! {