Fix mistake.

This commit is contained in:
Jason Lee 2024-09-04 19:00:50 +08:00
parent f2d75f7abd
commit 9e67525650
2 changed files with 6 additions and 5 deletions

View file

@ -39,10 +39,9 @@ pub use webview_story::WebViewStory;
use gpui::{
actions, div, prelude::FluentBuilder as _, px, AnyView, AppContext, Div, EventEmitter,
FocusableView, InteractiveElement, IntoElement, ParentElement, Pixels, Render, SharedString,
StatefulInteractiveElement, Styled as _, Task, View, ViewContext, VisualContext, WindowContext,
StatefulInteractiveElement, Styled as _, View, ViewContext, VisualContext, WindowContext,
};
use anyhow::Result;
use ui::{
divider::Divider,
dock::{Panel, PanelEvent, TabPanel},

View file

@ -128,11 +128,13 @@ impl TabPanel {
size: Option<Pixels>,
cx: &mut ViewContext<Self>,
) {
self.will_split_placement = Some(placement);
cx.spawn(|view, mut cx| async move {
cx.update(|cx| {
view.update(cx, |view, cx| view.split_panel(panel, placement, size, cx))
.ok()
view.update(cx, |view, cx| {
view.will_split_placement = Some(placement);
view.split_panel(panel, placement, size, cx)
})
.ok()
})
.ok()
})