Detect links in profile bios

This commit is contained in:
Paul Frazee 2022-11-23 14:53:33 -06:00
parent 2b37b6549b
commit 4eb8bc1249
4 changed files with 22 additions and 4 deletions

View file

@ -1,6 +1,8 @@
import {makeAutoObservable, runInAction} from 'mobx'
import * as GetProfile from '../../third-party/api/src/client/types/app/bsky/actor/getProfile'
import * as Profile from '../../third-party/api/src/client/types/app/bsky/actor/profile'
import {Entity} from '../../third-party/api/src/client/types/app/bsky/feed/post'
import {extractEntities} from '../../lib/strings'
import {Declaration} from './_common'
import {RootStoreModel} from './root-store'
import * as apilib from '../lib/api'
@ -41,6 +43,9 @@ export class ProfileViewModel {
postsCount: number = 0
myState = new ProfileViewMyStateModel()
// added data
descriptionEntities?: Entity[]
constructor(
public rootStore: RootStoreModel,
params: GetProfile.QueryParams,
@ -163,5 +168,6 @@ export class ProfileViewModel {
if (res.data.myState) {
Object.assign(this.myState, res.data.myState)
}
this.descriptionEntities = extractEntities(this.description || '')
}
}