Merge branch 'main' into upload-image

This commit is contained in:
João Ferreiro 2022-11-29 15:36:26 +00:00
commit dcb361329e
4 changed files with 12 additions and 7 deletions

View file

@ -1,3 +1,4 @@
import he from 'he'
import {
extractHtmlMeta,
isBskyAppUrl,
@ -59,8 +60,10 @@ export async function getLinkMeta(url: string): Promise<LinkMeta> {
const httpRes = await fetch(url)
const httpResBody = await httpRes.text()
const httpResMeta = extractHtmlMeta(httpResBody)
meta.title = httpResMeta.title
meta.title = httpResMeta.title ? he.decode(httpResMeta.title) : undefined
meta.description = httpResMeta.description
? he.decode(httpResMeta.description)
: undefined
// TODO meta.image = httpResMeta.image
} catch (e) {
// failed

View file

@ -9,12 +9,7 @@ import {
} from 'react-native'
import {Entity} from '../../../third-party/api/src/client/types/app/bsky/feed/post'
import {Link} from '../util/Link'
import {
LinkMeta,
getLinkMeta,
getLikelyType,
LikelyType,
} from '../../../lib/link-meta'
import {LinkMeta, getLikelyType, LikelyType} from '../../../lib/link-meta'
import {colors} from '../../lib/styles'
import {useStores} from '../../../state'