Bluesky app fork with some witchin' additions 💫

flatten may return undefined (#9387)

authored by samuel.fm and committed by

GitHub c92ac4ab b422765a

+5 -4
+2 -1
src/alf/typography.tsx
··· 25 25 fontFamily: Alf['fonts']['family'] 26 26 } & Pick<Alf, 'flags'>, 27 27 ) { 28 - const s = flatten(styles) 28 + const s = flatten(styles) ?? {} 29 + 29 30 // should always be defined on these components 30 31 s.fontSize = (s.fontSize || atoms.text_md.fontSize) * fontScale 31 32
+3 -3
src/components/RichText.tsx
··· 1 1 import React from 'react' 2 - import {type TextStyle} from 'react-native' 2 + import {type StyleProp, type TextStyle} from 'react-native' 3 3 import {AppBskyRichtextFacet, RichText as RichTextAPI} from '@atproto/api' 4 4 5 5 import {toShortUrl} from '#/lib/strings/url-helpers' ··· 21 21 enableTags?: boolean 22 22 authorHandle?: string 23 23 onLinkPress?: LinkProps['onPress'] 24 - interactiveStyle?: TextStyle 24 + interactiveStyle?: StyleProp<TextStyle> 25 25 emojiMultiplier?: number 26 26 shouldProxyLinks?: boolean 27 27 } ··· 55 55 56 56 if (!facets?.length) { 57 57 if (isOnlyEmoji(text)) { 58 - const flattenedStyle = flatten(style) 58 + const flattenedStyle = flatten(style) ?? {} 59 59 const fontSize = 60 60 (flattenedStyle.fontSize ?? a.text_sm.fontSize) * emojiMultiplier 61 61 return (