From e92e052b16fb91173aa4dc85d4e80fa569b8e60a Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 2 Oct 2024 14:25:14 -0700 Subject: [PATCH] fix: show error is GH sign in failed in vscode --- extensions/vscode/src/VsCodeIde.ts | 1 + .../OnboardingCard/components/QuickStartSubmitButton.tsx | 8 +++++++- gui/src/pages/More/MoreHelpRow.tsx | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/extensions/vscode/src/VsCodeIde.ts b/extensions/vscode/src/VsCodeIde.ts index ed7139636..e2fa97c9d 100644 --- a/extensions/vscode/src/VsCodeIde.ts +++ b/extensions/vscode/src/VsCodeIde.ts @@ -87,6 +87,7 @@ class VsCodeIde implements IDE { const session = await vscode.authentication.getSession("github", [], { silent: true, }); + if (session) { this.authToken = session.accessToken; return this.authToken; diff --git a/gui/src/components/OnboardingCard/components/QuickStartSubmitButton.tsx b/gui/src/components/OnboardingCard/components/QuickStartSubmitButton.tsx index fb8b21c0a..7ffd07ba2 100644 --- a/gui/src/components/OnboardingCard/components/QuickStartSubmitButton.tsx +++ b/gui/src/components/OnboardingCard/components/QuickStartSubmitButton.tsx @@ -40,8 +40,14 @@ function QuickstartSubmitButton() { const result = await ideMessenger.request("getGitHubAuthToken", { force: true, }); - if (result.status === "success") { + + if (result.status === "success" && typeof result.content === "string") { onComplete(); + } else { + ideMessenger.post("showToast", [ + "error", + "Failed to sign up for Continue free trial through GitHub", + ]); } } diff --git a/gui/src/pages/More/MoreHelpRow.tsx b/gui/src/pages/More/MoreHelpRow.tsx index 70a2bbfc0..8a0412dab 100644 --- a/gui/src/pages/More/MoreHelpRow.tsx +++ b/gui/src/pages/More/MoreHelpRow.tsx @@ -12,7 +12,7 @@ function MoreHelpRow({ title, description, onClick, Icon }: MoreHelpRowProps) { className="flex items-center gap-2 justify-between cursor-pointer" onClick={onClick} > -
+

{title}

{description}