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
@@ -6,7 +6,7 @@ import {
import {t} from '@lingui/core/macro'
import {type ImageMeta} from '#/state/gallery'
import * as Toast from '#/view/com/util/Toast'
import * as Toast from '#/components/Toast'
import {IS_IOS, IS_WEB} from '#/env'
import {VIDEO_MAX_DURATION_MS} from '../constants'
import {getDataUriSize} from './util'
@@ -30,7 +30,9 @@ export async function openPicker(opts?: ImagePickerOptions) {
return (response.assets ?? [])
.filter(asset => {
if (asset.mimeType?.startsWith('image/')) return true
Toast.show(t`Only image files are supported`, 'exclamation-circle')
Toast.show(t`Only image files are supported`, {
type: 'warning',
})
return false
})
.map(image => ({