Fix: only use scroll-positioning control on thread when looking at replies (#1587)
parent
588659380a
commit
6598fca79d
|
@ -2,6 +2,7 @@ import {makeAutoObservable, runInAction} from 'mobx'
|
||||||
import {
|
import {
|
||||||
AppBskyFeedGetPostThread as GetPostThread,
|
AppBskyFeedGetPostThread as GetPostThread,
|
||||||
AppBskyFeedDefs,
|
AppBskyFeedDefs,
|
||||||
|
AppBskyFeedPost,
|
||||||
PostModeration,
|
PostModeration,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {AtUri} from '@atproto/api'
|
import {AtUri} from '@atproto/api'
|
||||||
|
@ -76,6 +77,13 @@ export class PostThreadModel {
|
||||||
return this.rootStore.mutedThreads.uris.has(this.rootUri)
|
return this.rootStore.mutedThreads.uris.has(this.rootUri)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isCachedPostAReply() {
|
||||||
|
if (AppBskyFeedPost.isRecord(this.thread?.post.record)) {
|
||||||
|
return !!this.thread?.post.record.reply
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// public api
|
// public api
|
||||||
// =
|
// =
|
||||||
|
|
||||||
|
|
|
@ -367,7 +367,7 @@ export const PostThread = observer(function PostThread({
|
||||||
data={posts}
|
data={posts}
|
||||||
initialNumToRender={posts.length}
|
initialNumToRender={posts.length}
|
||||||
maintainVisibleContentPosition={
|
maintainVisibleContentPosition={
|
||||||
isNative && view.isFromCache
|
isNative && view.isFromCache && view.isCachedPostAReply
|
||||||
? MAINTAIN_VISIBLE_CONTENT_POSITION
|
? MAINTAIN_VISIBLE_CONTENT_POSITION
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue