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:
+10
-1
@@ -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?)
|
||||
|
||||
Reference in New Issue
Block a user