Create codemod for updating Toast calls to v2 (#10045)
This commit is contained in:
@@ -7,13 +7,13 @@ import {Trans} from '@lingui/react/macro'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {useAgent, useSession} from '#/state/session'
|
||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import * as Dialog from '#/components/Dialog'
|
||||
import * as TextField from '#/components/forms/TextField'
|
||||
import {Lock_Stroke2_Corner0_Rounded as Lock} from '#/components/icons/Lock'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {P, Text} from '#/components/Typography'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
import {useMutation, useQuery} from '@tanstack/react-query'
|
||||
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||
import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as RetryIcon} from '#/components/icons/ArrowRotate'
|
||||
import {Shapes_Stroke2_Corner0_Rounded as ShapesIcon} from '#/components/icons/Shapes'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import * as SettingsList from '../components/SettingsList'
|
||||
|
||||
export function OTAInfo() {
|
||||
@@ -34,7 +34,9 @@ export function OTAInfo() {
|
||||
await Updates.reloadAsync()
|
||||
},
|
||||
onError: error =>
|
||||
Toast.show(`Failed to update: ${error.message}`, 'xmark'),
|
||||
Toast.show(`Failed to update: ${error.message}`, {
|
||||
type: 'error',
|
||||
}),
|
||||
})
|
||||
|
||||
if (!Updates.isEnabled || __DEV__) {
|
||||
|
||||
Reference in New Issue
Block a user