🚸 update onboarding flow
This commit is contained in:
parent
695eab1b9f
commit
e349e76075
3 changed files with 11 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import { useNavigate } from "react-router-dom";
|
|||
import { Button, Input, SecondaryButton, vscForeground } from "../..";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { isJetBrains } from "../../../util";
|
||||
import { setLocalStorage } from "../../../util/localStorage";
|
||||
|
||||
interface GitHubSignInButtonProps {
|
||||
onComplete: (token: string) => void;
|
||||
|
|
@ -52,6 +53,7 @@ function GitHubSignInButton(props: GitHubSignInButtonProps) {
|
|||
await ideMessenger.request("setGitHubAuthToken", {
|
||||
token: jbGhAuthToken,
|
||||
});
|
||||
setLocalStorage("signedInToGh", true);
|
||||
props.onComplete(jbGhAuthToken);
|
||||
}}
|
||||
>
|
||||
|
|
@ -66,6 +68,7 @@ function GitHubSignInButton(props: GitHubSignInButtonProps) {
|
|||
"getGitHubAuthToken",
|
||||
undefined,
|
||||
);
|
||||
setLocalStorage("signedInToGh", true);
|
||||
props.onComplete(token);
|
||||
}}
|
||||
className="grid grid-flow-col items-center gap-2"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { useContext } from "react";
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import QuickModelSetup from "../../components/modelSelection/quickSetup/QuickModelSetup";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { getLocalStorage } from "../../util/localStorage";
|
||||
|
||||
function ApiKeyOnboarding() {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
|
@ -23,7 +24,12 @@ function ApiKeyOnboarding() {
|
|||
<QuickModelSetup
|
||||
onDone={() => {
|
||||
ideMessenger.post("showTutorial", undefined);
|
||||
navigate("/apiKeyAutocompleteOnboarding");
|
||||
|
||||
if (getLocalStorage("signedInToGh") === true) {
|
||||
navigate("/");
|
||||
} else {
|
||||
navigate("/apiKeyAutocompleteOnboarding");
|
||||
}
|
||||
}}
|
||||
></QuickModelSetup>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ type LocalStorageTypes = {
|
|||
inputHistory: JSONContent[];
|
||||
extensionVersion: string;
|
||||
indexingState: IndexingProgressUpdate;
|
||||
signedInToGh: boolean;
|
||||
};
|
||||
|
||||
export function getLocalStorage<T extends keyof LocalStorageTypes>(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue