git_ui: Feature flag repo selector (#23470)
Fixes an issue where the repo selector showed for all users, not just those in the git_ui feature flag. This was meant to be included in the `git_ui` feature flag. Release Notes: - N/A
This commit is contained in:
parent
bed917b0b1
commit
5be2784ddb
5 changed files with 49 additions and 12 deletions
|
@ -1,4 +1,6 @@
|
|||
use ::settings::Settings;
|
||||
use feature_flags::WaitForFlag;
|
||||
use futures::{select_biased, FutureExt};
|
||||
use git::status::FileStatus;
|
||||
use git_panel_settings::GitPanelSettings;
|
||||
use gpui::{AppContext, Hsla};
|
||||
|
@ -12,6 +14,17 @@ pub fn init(cx: &mut AppContext) {
|
|||
GitPanelSettings::register(cx);
|
||||
}
|
||||
|
||||
// TODO: Remove this before launching Git UI
|
||||
pub async fn git_ui_enabled(flag: WaitForFlag) -> bool {
|
||||
let mut git_ui_feature_flag = 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,
|
||||
}
|
||||
}
|
||||
|
||||
const ADDED_COLOR: Hsla = Hsla {
|
||||
h: 142. / 360.,
|
||||
s: 0.68,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue