Create codemod for updating Toast calls to v2 (#10045)

This commit is contained in:
DS Boyce
2026-03-12 11:35:58 -07:00
committed by GitHub
parent 9c9970f680
commit 35cb2bcf94
62 changed files with 422 additions and 171 deletions
+7 -9
View File
@@ -5,7 +5,7 @@ import {useLingui} from '@lingui/react'
import {logger} from '#/logger'
import {type SessionAccount, useSessionApi} from '#/state/session'
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
import * as Toast from '#/view/com/util/Toast'
import * as Toast from '#/components/Toast'
import {useAnalytics} from '#/analytics'
import {type Metrics} from '#/analytics/metrics'
import {IS_WEB} from '#/env'
@@ -42,20 +42,18 @@ export function useAccountSwitcher() {
Toast.show(_(msg`Signed in as @${account.handle}`))
} else {
requestSwitchToAccount({requestedAccount: account.did})
Toast.show(
_(msg`Please sign in as @${account.handle}`),
'circle-exclamation',
)
Toast.show(_(msg`Please sign in as @${account.handle}`), {
type: 'warning',
})
}
} catch (e: any) {
logger.error(`switch account: selectAccount failed`, {
message: e.message,
})
requestSwitchToAccount({requestedAccount: account.did})
Toast.show(
_(msg`Please sign in as @${account.handle}`),
'circle-exclamation',
)
Toast.show(_(msg`Please sign in as @${account.handle}`), {
type: 'warning',
})
} finally {
setPendingDid(null)
}