title_bar: Simplify git-ui
feature flag check (#23475)
This PR is a follow-up to https://github.com/zed-industries/zed/pull/23470 that simplifies the way we check the `git-ui` feature flag in the title bar. Release Notes: - N/A
This commit is contained in:
parent
5930b552b9
commit
9f87145af9
5 changed files with 25 additions and 45 deletions
|
@ -389,7 +389,16 @@ fn initialize_panels(prompt_builder: Arc<PromptBuilder>, cx: &mut ViewContext<Wo
|
|||
workspace.add_panel(notification_panel, cx);
|
||||
})?;
|
||||
|
||||
let git_ui_enabled = git_ui::git_ui_enabled(git_ui_feature_flag).await;
|
||||
let git_ui_enabled = {
|
||||
let mut git_ui_feature_flag = git_ui_feature_flag.fuse();
|
||||
let mut timeout =
|
||||
FutureExt::fuse(smol::Timer::after(std::time::Duration::from_secs(5)));
|
||||
|
||||
select_biased! {
|
||||
is_git_ui_enabled = git_ui_feature_flag => is_git_ui_enabled,
|
||||
_ = timeout => false,
|
||||
}
|
||||
};
|
||||
|
||||
let git_panel = if git_ui_enabled {
|
||||
Some(git_ui::git_panel::GitPanel::load(workspace_handle.clone(), cx.clone()).await?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue