Rename Slice to ThreadItem
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
import {
|
||||
HiddenReplyKind,
|
||||
type PostThreadParams,
|
||||
type Slice,
|
||||
type ThreadItem,
|
||||
type TraversalMetadata,
|
||||
} from '#/state/queries/usePostThread/types'
|
||||
import {
|
||||
@@ -36,9 +36,9 @@ export function traverse(
|
||||
view: PostThreadParams['view']
|
||||
},
|
||||
) {
|
||||
const items: Slice[] = []
|
||||
const hidden: Slice[] = []
|
||||
const muted: Slice[] = []
|
||||
const items: ThreadItem[] = []
|
||||
const hidden: ThreadItem[] = []
|
||||
const muted: ThreadItem[] = []
|
||||
const metadatas = new Map<string, TraversalMetadata>()
|
||||
|
||||
traversal: for (let i = 0; i < thread.length; i++) {
|
||||
|
||||
@@ -32,7 +32,7 @@ export enum HiddenReplyKind {
|
||||
Muted = 'muted',
|
||||
}
|
||||
|
||||
export type Slice =
|
||||
export type ThreadItem =
|
||||
| {
|
||||
type: 'threadPost'
|
||||
key: string
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@atproto/api'
|
||||
|
||||
import {
|
||||
type Slice,
|
||||
type ThreadItem,
|
||||
type TraversalMetadata,
|
||||
} from '#/state/queries/usePostThread/types'
|
||||
import * as bsky from '#/types/bsky'
|
||||
@@ -122,7 +122,7 @@ export function getThreadPostUI({
|
||||
repliesSeenCount,
|
||||
repliesUnhydrated,
|
||||
precedesChildReadMore,
|
||||
}: TraversalMetadata): Extract<Slice, {type: 'threadPost'}>['ui'] {
|
||||
}: TraversalMetadata): Extract<ThreadItem, {type: 'threadPost'}>['ui'] {
|
||||
// TODO might be able to simplify this
|
||||
const isReplyAndHasReplies =
|
||||
depth > 0 &&
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
|
||||
import {makeProfileLink} from '#/lib/routes/links'
|
||||
import {
|
||||
type Slice,
|
||||
type ThreadItem,
|
||||
type TraversalMetadata,
|
||||
} from '#/state/queries/usePostThread/types'
|
||||
|
||||
@@ -19,7 +19,7 @@ export function threadPostNoUnauthenticated({
|
||||
depth,
|
||||
value,
|
||||
}: AppBskyUnspeccedGetPostThreadV2.ThreadItem): Extract<
|
||||
Slice,
|
||||
ThreadItem,
|
||||
{type: 'threadPostNoUnauthenticated'}
|
||||
> {
|
||||
return {
|
||||
@@ -36,7 +36,7 @@ export function threadPostNotFound({
|
||||
depth,
|
||||
value,
|
||||
}: AppBskyUnspeccedGetPostThreadV2.ThreadItem): Extract<
|
||||
Slice,
|
||||
ThreadItem,
|
||||
{type: 'threadPostNotFound'}
|
||||
> {
|
||||
return {
|
||||
@@ -53,7 +53,7 @@ export function threadPostBlocked({
|
||||
depth,
|
||||
value,
|
||||
}: AppBskyUnspeccedGetPostThreadV2.ThreadItem): Extract<
|
||||
Slice,
|
||||
ThreadItem,
|
||||
{type: 'threadPostBlocked'}
|
||||
> {
|
||||
return {
|
||||
@@ -75,7 +75,7 @@ export function threadPost({
|
||||
depth: number
|
||||
value: $Typed<AppBskyUnspeccedGetPostThreadV2.ThreadItemPost>
|
||||
moderationOpts: ModerationOpts
|
||||
}): Extract<Slice, {type: 'threadPost'}> {
|
||||
}): Extract<ThreadItem, {type: 'threadPost'}> {
|
||||
return {
|
||||
type: 'threadPost',
|
||||
key: uri,
|
||||
@@ -102,7 +102,7 @@ export function readMore({
|
||||
repliesUnhydrated,
|
||||
skippedIndentIndices,
|
||||
postData,
|
||||
}: TraversalMetadata): Extract<Slice, {type: 'readMore'}> {
|
||||
}: TraversalMetadata): Extract<ThreadItem, {type: 'readMore'}> {
|
||||
const urip = new AtUri(postData.uri)
|
||||
const href = makeProfileLink(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user