few more things

This commit is contained in:
Hailey
2024-04-15 02:47:43 -07:00
parent dbbcd275b4
commit d56116a6f4
3 changed files with 5 additions and 16 deletions
@@ -49,7 +49,9 @@ export class ReactNativeKey extends Key {
// We don't need to validate this, because the native types ensure it is correct. But this is a TODO
// for the same reason above
const protectedHeader = result.protectedHeader
const protectedHeader = Object.fromEntries(
Object.entries(result.protectedHeader).filter(([_, v]) => v !== null),
)
if (options?.audience != null) {
const audience = Array.isArray(options.audience)
@@ -14,13 +14,10 @@ type Item = {
type EncodedKey = {
keyId: string
keyPair: CryptoKeyPair
keyPair: CryptoKey
}
function encodeKey(key: Key): EncodedKey {
if (!(key instanceof WebcryptoKey) || !key.kid) {
throw new Error('Invalid key object')
}
return {
keyId: key.kid,
keyPair: key.cryptoKeyPair,
@@ -42,7 +39,6 @@ export type Schema = {
}>
session: Item<{
dpopKey: EncodedKey
tokenSet: TokenSet
}>
+1 -10
View File
@@ -1,12 +1,10 @@
import React from 'react'
import {Keyboard, View} from 'react-native'
import * as Browser from 'expo-web-browser'
import {ComAtprotoServerDescribeServer} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useAnalytics} from '#/lib/analytics/analytics'
import {isAndroid} from 'platform/detection'
import {useLogin} from '#/screens/Login/hooks/useLogin'
import {atoms as a} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
@@ -34,14 +32,7 @@ export const LoginForm = ({
}) => {
const {track} = useAnalytics()
const {_} = useLingui()
const {openAuthSession} = useLogin(serviceUrl)
// This improves speed at which the browser presents itself on Android
React.useEffect(() => {
if (isAndroid) {
Browser.warmUpAsync()
}
}, [])
const {openAuthSession} = useLogin()
const onPressSelectService = React.useCallback(() => {
Keyboard.dismiss()