fix: resolve context menu race condition and add debug logs
This commit is contained in:
@@ -12,8 +12,9 @@ pub fn ContextMenu(
|
||||
let hash = torrent_hash.clone();
|
||||
let action_str = action.to_string();
|
||||
|
||||
on_close.call(()); // Always close menu
|
||||
on_action.call((action_str, hash)); // Delegate
|
||||
logging::log!("ContextMenu: Action '{}' for hash '{}'", action_str, hash);
|
||||
on_action.call((action_str, hash)); // Delegate FIRST
|
||||
on_close.call(()); // Close menu AFTER
|
||||
};
|
||||
|
||||
if !visible {
|
||||
|
||||
@@ -40,7 +40,10 @@ pub fn Modal(
|
||||
class=format!("flex-1 px-4 py-3 rounded-xl transition-all font-bold text-white shadow-lg {}",
|
||||
if is_danger { "bg-red-500 hover:bg-red-600 shadow-red-500/20" } else { "bg-blue-500 hover:bg-blue-600 shadow-blue-500/20" }
|
||||
)
|
||||
on:click=move |_| on_confirm.with_value(|cb| cb.call(()))
|
||||
on:click=move |_| {
|
||||
logging::log!("Modal: Confirm clicked");
|
||||
on_confirm.with_value(|cb| cb.call(()))
|
||||
}
|
||||
>
|
||||
{confirm_text.get_value()}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user