Remove internal actions from CopilotCodeVerification

This commit is contained in:
Antonio Scandurra 2023-04-27 14:25:34 +02:00
parent 32f21771a6
commit 816eb06a7b

View file

@ -2,7 +2,6 @@ use crate::{request::PromptUserDeviceFlow, Copilot, Status};
use gpui::{
elements::*,
geometry::rect::RectF,
impl_internal_actions,
platform::{WindowBounds, WindowKind, WindowOptions},
AnyElement, AnyViewHandle, AppContext, ClipboardItem, Element, Entity, View, ViewContext,
ViewHandle,
@ -10,11 +9,6 @@ use gpui::{
use settings::Settings;
use theme::ui::modal;
#[derive(PartialEq, Eq, Debug, Clone)]
struct ClickedConnect;
impl_internal_actions!(copilot_verification, [ClickedConnect]);
#[derive(PartialEq, Eq, Debug, Clone)]
struct CopyUserCode;
@ -68,12 +62,6 @@ pub fn init(cx: &mut AppContext) {
}
})
.detach();
cx.add_action(
|code_verification: &mut CopilotCodeVerification, _: &ClickedConnect, _| {
code_verification.connect_clicked = true;
},
);
}
}
@ -219,9 +207,9 @@ impl CopilotCodeVerification {
cx,
{
let verification_uri = data.verification_uri.clone();
move |_, _, cx| {
move |_, verification, cx| {
cx.platform().open_url(&verification_uri);
cx.dispatch_action(ClickedConnect)
verification.connect_clicked = true;
}
},
))