Unify the display name fallback behavior
This commit is contained in:
parent
4e56d24a9d
commit
9c02fbb925
3 changed files with 16 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
import {AppBskyFeedDefs, AtUri} from '@atproto/api'
|
||||
import {makeAutoObservable} from 'mobx'
|
||||
import {RootStoreModel} from 'state/models/root-store'
|
||||
import {sanitizeDisplayName} from 'lib/strings/display-names'
|
||||
|
||||
export class CustomFeedModel {
|
||||
// data
|
||||
|
@ -34,6 +35,13 @@ export class CustomFeedModel {
|
|||
return this.data.uri
|
||||
}
|
||||
|
||||
get displayName() {
|
||||
if (this.data.displayName) {
|
||||
return sanitizeDisplayName(this.data.displayName)
|
||||
}
|
||||
return `Feed by @${this.data.creator.handle}`
|
||||
}
|
||||
|
||||
get isSaved() {
|
||||
return this.data.viewer?.saved
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue