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
+4 -2
View File
@@ -7,11 +7,11 @@ import {useRequireEmailVerification} from '#/lib/hooks/useRequireEmailVerificati
import {logger} from '#/logger'
import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members'
import {FAB} from '#/view/com/util/fab/FAB'
import * as Toast from '#/view/com/util/Toast'
import {useTheme} from '#/alf'
import * as Dialog from '#/components/Dialog'
import {SearchablePeopleList} from '#/components/dialogs/SearchablePeopleList'
import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus'
import * as Toast from '#/components/Toast'
import {useAnalytics} from '#/analytics'
export function NewChat({
@@ -37,7 +37,9 @@ export function NewChat({
},
onError: error => {
logger.error('Failed to create chat', {safeMessage: error})
Toast.show(_(msg`An issue occurred starting the chat`), 'xmark')
Toast.show(_(msg`An issue occurred starting the chat`), {
type: 'error',
})
},
})
@@ -4,9 +4,9 @@ import {useLingui} from '@lingui/react'
import {logger} from '#/logger'
import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members'
import * as Toast from '#/view/com/util/Toast'
import * as Dialog from '#/components/Dialog'
import {SearchablePeopleList} from '#/components/dialogs/SearchablePeopleList'
import * as Toast from '#/components/Toast'
import {useAnalytics} from '#/analytics'
export function SendViaChatDialog({
@@ -47,10 +47,9 @@ function SendViaChatDialogInner({
},
onError: error => {
logger.error('Failed to share post to chat', {message: error})
Toast.show(
_(msg`An issue occurred while trying to open the chat`),
'xmark',
)
Toast.show(_(msg`An issue occurred while trying to open the chat`), {
type: 'error',
})
},
})