From f8a52aa527a13a74941841b0de8bb82a27cc9895 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 5 Feb 2025 11:33:21 -0600 Subject: [PATCH] Use asPredicate --- src/components/StarterPack/QrCodeDialog.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/StarterPack/QrCodeDialog.tsx b/src/components/StarterPack/QrCodeDialog.tsx index 79de3bfba5..63d58a0f44 100644 --- a/src/components/StarterPack/QrCodeDialog.tsx +++ b/src/components/StarterPack/QrCodeDialog.tsx @@ -4,7 +4,11 @@ import type ViewShot from 'react-native-view-shot' import {requestMediaLibraryPermissionsAsync} from 'expo-image-picker' import {createAssetAsync} from 'expo-media-library' import * as Sharing from 'expo-sharing' -import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api' +import { + AppBskyGraphDefs, + AppBskyGraphStarterpack, + asPredicate, +} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -77,7 +81,11 @@ export function QrCodeDialog({ } else { setIsProcessing(true) - if (!AppBskyGraphStarterpack.isValidRecord(starterPack.record)) { + if ( + !asPredicate(AppBskyGraphStarterpack.validateRecord)( + starterPack.record, + ) + ) { return }