Use dangerousIsType

This commit is contained in:
Eric Bailey
2025-01-07 20:11:16 -06:00
parent 9773355b15
commit f6488dd2f7
+7 -1
View File
@@ -13,6 +13,7 @@ import {useTheme} from '#/alf'
import {atoms as a} from '#/alf'
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
import {Text} from '#/components/Typography'
import * as atp from '#/types/atproto'
const LazyViewShot = React.lazy(
// @ts-expect-error dynamic import
@@ -30,7 +31,12 @@ export const QrCode = React.forwardRef<ViewShot, Props>(function QrCode(
) {
const {record} = starterPack
if (!AppBskyGraphStarterpack.isRecord(record)) {
if (
!atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
record,
AppBskyGraphStarterpack.isRecord,
)
) {
return null
}