-
Notifications
You must be signed in to change notification settings - Fork 670
fix(gui): Cursor OAuth accounts stay visible + toast login status #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
38f33f0
7b5e97d
28034c6
5abdbbb
70cc339
3bb1a3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ export default function ProviderCatalog({ | |
| onLogin, | ||
| onCancelLogin, | ||
| onLogout, | ||
| onManage, | ||
| }: { | ||
| presets: CatalogPreset[]; | ||
| usageRank?: Record<string, number>; | ||
|
|
@@ -52,9 +53,11 @@ export default function ProviderCatalog({ | |
| accountRows?: AccountLoginRow[]; | ||
| accountStatus?: Record<string, AccountLoginStatus>; | ||
| busyProvider?: string | null; | ||
| onLogin?: (provider: string) => void; | ||
| onLogin?: (provider: string, addAccount?: boolean) => void; | ||
| onCancelLogin?: (provider: string) => void; | ||
| onLogout?: (provider: string) => void; | ||
| /** Jump to the provider's Accounts surface in the workspace. */ | ||
| onManage?: (provider: string) => void; | ||
| }) { | ||
| const t = useT(); | ||
| const [tier, setTier] = useState<CatalogTier>(initialTier); | ||
|
|
@@ -172,7 +175,33 @@ export default function ProviderCatalog({ | |
| )} | ||
| </> | ||
| ) : loggedIn ? ( | ||
| onLogout && <button type="button" className="btn btn-ghost" onClick={() => onLogout(row.id)}>{t("modal.accountLogout")}</button> | ||
| <> | ||
| {onManage && ( | ||
| <button type="button" className="btn btn-ghost" onClick={() => onManage(row.id)}> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Deleting an OAuth provider removes its config row but deliberately leaves its stored credential, so Add Provider → Accounts still considers that provider logged in. In that state this new Manage button closes the modal and selects a provider absent from AGENTS.md reference: gui/AGENTS.md:L10-L10 Useful? React with 👍 / 👎. |
||
| {t("modal.accountManage")} | ||
| </button> | ||
| )} | ||
| {onLogin && ( | ||
| <button | ||
| type="button" | ||
| className="btn btn-ghost" | ||
| disabled={busy} | ||
| onClick={() => { if (!busy) onLogin(row.id, true); }} | ||
| > | ||
| {busy ? t("prov.waitingBrowser") : t("modal.accountAdd")} | ||
| </button> | ||
| )} | ||
| {busy && onCancelLogin && ( | ||
| <button type="button" className="btn btn-ghost" onClick={() => onCancelLogin(row.id)}> | ||
| {t("common.cancel")} | ||
| </button> | ||
| )} | ||
| {onLogout && !busy && ( | ||
| <button type="button" className="btn btn-ghost" onClick={() => onLogout(row.id)}> | ||
| {t("modal.accountLogout")} | ||
| </button> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| )} | ||
| </> | ||
| ) : busy ? ( | ||
| onCancelLogin && <button type="button" className="btn btn-ghost" onClick={() => onCancelLogin(row.id)}>{t("common.cancel")}</button> | ||
| ) : ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.