feat: unify research in profile-bound decks with TweetDeck-style UI
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Post, PostPage, ThreadPage } from './types'
|
||||
import type { Post, PostPage } from './types'
|
||||
|
||||
export function flattenPostPages(pages: PostPage[]): Post[] {
|
||||
const seen = new Set<string>()
|
||||
@@ -10,17 +10,3 @@ export function flattenPostPages(pages: PostPage[]): Post[] {
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
export function focalPostFromPages(
|
||||
pages: Array<PostPage | ThreadPage>,
|
||||
): Post | undefined {
|
||||
const first = pages[0]
|
||||
return first && 'focalPost' in first ? first.focalPost : undefined
|
||||
}
|
||||
|
||||
export function flattenConversationPages(
|
||||
pages: Array<PostPage | ThreadPage>,
|
||||
focalPostId: string,
|
||||
): Post[] {
|
||||
return flattenPostPages(pages).filter(({ id }) => id !== focalPostId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user