mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
fix(cloud): the sign-in toast always shows the current phase's button (Cancel / Open again)
This commit is contained in:
@@ -80,18 +80,24 @@ export function cloudAgentSignInView(
|
||||
'Finish signing in to {{agent}} in your browser…',
|
||||
{ agent: name }
|
||||
),
|
||||
...(setup.canReopen
|
||||
// Every phase has a button: an updated toast keeps the last one otherwise.
|
||||
action: setup.canReopen
|
||||
? {
|
||||
action: {
|
||||
label: translate('orcaCloudAccounts.openAgain', 'Open again'),
|
||||
run: () => void api?.reopen({ agent })
|
||||
}
|
||||
label: translate('orcaCloudAccounts.openAgain', 'Open again'),
|
||||
run: () => void api?.reopen({ agent })
|
||||
}
|
||||
: {
|
||||
label: translate('orcaCloudAccounts.cancel', 'Cancel'),
|
||||
run: () => void api?.cancel({ agent })
|
||||
}
|
||||
: {})
|
||||
}
|
||||
case 'preparing':
|
||||
return {
|
||||
message: translate('orcaCloudAccounts.preparing', 'Getting ChatGPT sign-in ready')
|
||||
message: translate('orcaCloudAccounts.preparing', 'Getting ChatGPT sign-in ready'),
|
||||
action: {
|
||||
label: translate('orcaCloudAccounts.cancel', 'Cancel'),
|
||||
run: () => void api?.cancel({ agent })
|
||||
}
|
||||
}
|
||||
case 'device':
|
||||
return {
|
||||
@@ -168,10 +174,6 @@ export function showCloudAgentNotStartedToast(
|
||||
run: () => void globalThis.window?.api?.orcaCloudAgents?.start({ agent })
|
||||
}
|
||||
}
|
||||
if (!view.action) {
|
||||
// Sonner keeps an updated toast's old button: drop it so a stale action can't linger.
|
||||
toast.dismiss(TOAST_ID)
|
||||
}
|
||||
toast.message(view.message, {
|
||||
id: TOAST_ID,
|
||||
...(view.description ? { description: view.description } : {}),
|
||||
|
||||
Reference in New Issue
Block a user