mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
fix(ui): drop the ChatGPT sign-in dialog's success text that closes before it shows
This commit is contained in:
parent
ae96eae705
commit
95db4b5217
3 changed files with 5 additions and 7 deletions
|
|
@ -104,8 +104,6 @@ export default function ChatGPTSignInModal({ credentialName, request, onClose, o
|
|||
</div>
|
||||
)}
|
||||
|
||||
{state.kind === "connected" && <p className="text-sm">Signed in with ChatGPT.</p>}
|
||||
|
||||
{state.kind === "failed" && (
|
||||
<p role="alert" className="text-sm text-destructive">
|
||||
{signInFailureMessage(state)}
|
||||
|
|
@ -118,7 +116,7 @@ export default function ChatGPTSignInModal({ credentialName, request, onClose, o
|
|||
Start again
|
||||
</Button>
|
||||
)}
|
||||
<Button onClick={onClose}>{state.kind === "connected" ? "Done" : "Close"}</Button>
|
||||
<Button onClick={onClose}>Close</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ describe("signInFlowReducer", () => {
|
|||
expect(pending).toEqual({ ...awaiting, pollCount: 1 });
|
||||
});
|
||||
|
||||
it("connects with the account id from the poll", () => {
|
||||
expect(connected()).toEqual({ kind: "connected", attempt: 0, accountId: "acct-1" });
|
||||
it("connects once the poll says connected", () => {
|
||||
expect(connected()).toEqual({ kind: "connected", attempt: 0 });
|
||||
});
|
||||
|
||||
it("expires locally once the code lifetime has passed", () => {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export type SignInFlowState =
|
|||
readonly intervalSeconds: number;
|
||||
readonly flowHandle: string;
|
||||
}
|
||||
| { readonly kind: "connected"; readonly attempt: number; readonly accountId: string | null }
|
||||
| { readonly kind: "connected"; readonly attempt: number }
|
||||
| {
|
||||
readonly kind: "failed";
|
||||
readonly attempt: number;
|
||||
|
|
@ -117,7 +117,7 @@ const afterPoll = (
|
|||
case "pending":
|
||||
return { ...state, pollCount: state.pollCount + 1 };
|
||||
case "connected":
|
||||
return { kind: "connected", attempt: state.attempt, accountId: response.account_id };
|
||||
return { kind: "connected", attempt: state.attempt };
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue