Combine observe_new_views into one in feedback crate (#6755)
Combine two `observe_new_views` calls into a single one in `init` function of feedback crate. Release Notes: - N/A
This commit is contained in:
parent
14322c8365
commit
47860a5dc8
1 changed files with 16 additions and 20 deletions
|
|
@ -20,11 +20,8 @@ actions!(
|
||||||
);
|
);
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
// TODO: a way to combine these two into one?
|
cx.observe_new_views(|workspace: &mut Workspace, cx| {
|
||||||
cx.observe_new_views(feedback_modal::FeedbackModal::register)
|
feedback_modal::FeedbackModal::register(workspace, cx);
|
||||||
.detach();
|
|
||||||
|
|
||||||
cx.observe_new_views(|workspace: &mut Workspace, _| {
|
|
||||||
workspace
|
workspace
|
||||||
.register_action(|_, _: &CopySystemSpecsIntoClipboard, cx| {
|
.register_action(|_, _: &CopySystemSpecsIntoClipboard, cx| {
|
||||||
let specs = SystemSpecs::new(&cx).to_string();
|
let specs = SystemSpecs::new(&cx).to_string();
|
||||||
|
|
@ -39,8 +36,7 @@ pub fn init(cx: &mut AppContext) {
|
||||||
prompt.await.ok();
|
prompt.await.ok();
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
let item = ClipboardItem::new(specs.clone());
|
cx.write_to_clipboard(ClipboardItem::new(specs.clone()));
|
||||||
cx.write_to_clipboard(item);
|
|
||||||
})
|
})
|
||||||
.register_action(|_, _: &RequestFeature, cx| {
|
.register_action(|_, _: &RequestFeature, cx| {
|
||||||
let url = "https://github.com/zed-industries/zed/issues/new?assignees=&labels=enhancement%2Ctriage&template=0_feature_request.yml";
|
let url = "https://github.com/zed-industries/zed/issues/new?assignees=&labels=enhancement%2Ctriage&template=0_feature_request.yml";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue