QT Jump Pt. 2 - Remove code duplication (#3506)

* remove code duplication

* now it's safe to remove shimmer
This commit is contained in:
Hailey 2024-04-12 10:00:44 -07:00 committed by GitHub
parent 7047755c50
commit eb2fd53340
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 49 deletions

View file

@ -11,7 +11,7 @@ import {getAgent} from '#/state/session'
import {findAllPostsInQueryData as findAllPostsInNotifsQueryData} from './notifications/feed'
import {findAllPostsInQueryData as findAllPostsInFeedQueryData} from './post-feed'
import {precacheThreadPostProfiles} from './profile'
import {getEmbeddedPost} from './util'
import {embedViewRecordToPostView, getEmbeddedPost} from './util'
const RQKEY_ROOT = 'post-thread'
export const RQKEY = (uri: string) => [RQKEY_ROOT, uri]
@ -332,14 +332,7 @@ function embedViewRecordToPlaceholderThread(
type: 'post',
_reactKey: record.uri,
uri: record.uri,
post: {
uri: record.uri,
cid: record.cid,
author: record.author,
record: record.value,
indexedAt: record.indexedAt,
labels: record.labels,
},
post: embedViewRecordToPostView(record),
record: record.value as AppBskyFeedPost.Record, // validated in getEmbeddedPost
parent: undefined,
replies: undefined,