onboarding: Fix a double lease panic caused by Onboarding::clone_on_split (#35815)

Release Notes:

- N/A
This commit is contained in:
Anthony Eid 2025-08-08 13:02:17 -04:00 committed by GitHub
parent 327456d1d2
commit f2435f7284
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -565,9 +565,13 @@ impl Item for Onboarding {
_: &mut Window,
cx: &mut Context<Self>,
) -> Option<Entity<Self>> {
self.workspace
.update(cx, |workspace, cx| Onboarding::new(workspace, cx))
.ok()
Some(cx.new(|cx| Onboarding {
workspace: self.workspace.clone(),
user_store: self.user_store.clone(),
selected_page: self.selected_page,
focus_handle: cx.focus_handle(),
_settings_subscription: cx.observe_global::<SettingsStore>(move |_, cx| cx.notify()),
}))
}
fn to_item_events(event: &Self::Event, mut f: impl FnMut(workspace::item::ItemEvent)) {