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