Fix missing breadcrumbs on first open of project search.

Piotr Osiewicz created

Fixes:
Project search does not have breadcrumbs on its first open: after switching to other tab and back, breadcrumbs are shown

Change summary

crates/breadcrumbs2/src/breadcrumbs.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Detailed changes

crates/breadcrumbs2/src/breadcrumbs.rs 🔗

@@ -86,8 +86,13 @@ impl ToolbarItemView for Breadcrumbs {
                 cx,
                 Box::new(move |event, cx| {
                     if let ItemEvent::UpdateBreadcrumbs = event {
-                        this.update(cx, |_, cx| {
+                        this.update(cx, |this, cx| {
                             cx.notify();
+                            if let Some(active_item) = this.active_item.as_ref() {
+                                cx.emit(ToolbarItemEvent::ChangeLocation(
+                                    active_item.breadcrumb_location(cx),
+                                ))
+                            }
                         })
                         .ok();
                     }