Fix panic feature flag detection (#35245)
The flag was being checked before feature flags were resolved. Release Notes: - N/A
This commit is contained in:
parent
ca34ead6d9
commit
11c7b498b3
1 changed files with 22 additions and 11 deletions
|
@ -126,17 +126,28 @@ pub fn init(cx: &mut App) {
|
|||
cx.on_action(quit);
|
||||
|
||||
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
|
||||
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
|
||||
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
|
||||
cx.on_action(|_: &TestCrash, _| {
|
||||
unsafe extern "C" {
|
||||
fn puts(s: *const i8);
|
||||
}
|
||||
unsafe {
|
||||
puts(0xabad1d3a as *const i8);
|
||||
}
|
||||
});
|
||||
}
|
||||
let flag = cx.wait_for_flag::<PanicFeatureFlag>();
|
||||
cx.spawn(async |cx| {
|
||||
if cx
|
||||
.update(|cx| ReleaseChannel::global(cx) == ReleaseChannel::Dev)
|
||||
.unwrap_or_default()
|
||||
|| flag.await
|
||||
{
|
||||
cx.update(|cx| {
|
||||
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
|
||||
cx.on_action(|_: &TestCrash, _| {
|
||||
unsafe extern "C" {
|
||||
fn puts(s: *const i8);
|
||||
}
|
||||
unsafe {
|
||||
puts(0xabad1d3a as *const i8);
|
||||
}
|
||||
});
|
||||
})
|
||||
.ok();
|
||||
};
|
||||
})
|
||||
.detach();
|
||||
cx.on_action(|_: &OpenLog, cx| {
|
||||
with_active_or_new_workspace(cx, |workspace, window, cx| {
|
||||
open_log_file(workspace, window, cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue