Use dangerousIsType
This commit is contained in:
@@ -13,6 +13,7 @@ import {useTheme} from '#/alf'
|
|||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
import * as atp from '#/types/atproto'
|
||||||
|
|
||||||
const LazyViewShot = React.lazy(
|
const LazyViewShot = React.lazy(
|
||||||
// @ts-expect-error dynamic import
|
// @ts-expect-error dynamic import
|
||||||
@@ -30,7 +31,12 @@ export const QrCode = React.forwardRef<ViewShot, Props>(function QrCode(
|
|||||||
) {
|
) {
|
||||||
const {record} = starterPack
|
const {record} = starterPack
|
||||||
|
|
||||||
if (!AppBskyGraphStarterpack.isRecord(record)) {
|
if (
|
||||||
|
!atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
|
record,
|
||||||
|
AppBskyGraphStarterpack.isRecord,
|
||||||
|
)
|
||||||
|
) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user