From 42259a400742b510435649b26dd6a1d2333cc24a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 24 Oct 2023 17:48:18 +0200 Subject: [PATCH] Fix channel dragging Co-authored-by: Conrad Co-authored-by: Joseph --- crates/collab_ui/src/collab_panel.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index 66962b040271729b26e78732c3a78aaa6483280f..16f8fb5d022c3eb483b68e06cefe6a647d61000e 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -2143,7 +2143,7 @@ impl CollabPanel { .on_up(MouseButton::Left, move |_, this, cx| { if let Some((_, dragged_channel)) = cx .global::>() - .currently_dragged::>(cx.window()) + .currently_dragged::(cx.window()) { this.channel_store .update(cx, |channel_store, cx| { @@ -2155,20 +2155,18 @@ impl CollabPanel { .on_move({ let channel = channel.clone(); move |_, this, cx| { - if let Some((_, dragged_channel_id)) = cx + if let Some((_, dragged_channel)) = cx .global::>() - .currently_dragged::(cx.window()) + .currently_dragged::(cx.window()) { - if this.drag_target_channel != Some(*dragged_channel_id) { + if channel.id != dragged_channel.id { this.drag_target_channel = Some(channel.id); - } else { - this.drag_target_channel = None; } cx.notify() } } }) - .as_draggable( + .as_draggable::<_, Channel>( channel.clone(), move |_, channel, cx: &mut ViewContext| { let theme = &theme::current(cx).collab_panel;