diff options
author | dan <dan.abramov@gmail.com> | 2024-08-06 17:12:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 17:12:27 +0100 |
commit | 5845e08eeea151deb75bb21ceaa33f7a973870e3 (patch) | |
tree | b0e3e8437db37c4e52789182079fde4f68cd2f2b /src/view/com/post-thread/PostThread.tsx | |
parent | b291a1ed8a1706f30f117d691d85508ffad342f2 (diff) | |
download | voidsky-5845e08eeea151deb75bb21ceaa33f7a973870e3.tar.zst |
Show own replies before follows' replies in threads (#4882)
Diffstat (limited to 'src/view/com/post-thread/PostThread.tsx')
-rw-r--r-- | src/view/com/post-thread/PostThread.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx index a6c1a4648..b7eaedd36 100644 --- a/src/view/com/post-thread/PostThread.tsx +++ b/src/view/com/post-thread/PostThread.tsx @@ -89,7 +89,7 @@ export function PostThread({ onCanReply: (canReply: boolean) => void onPressReply: () => unknown }) { - const {hasSession} = useSession() + const {hasSession, currentAccount} = useSession() const {_} = useLingui() const t = useTheme() const {isMobile, isTabletOrMobile} = useWebMediaQueries() @@ -154,6 +154,7 @@ export function PostThread({ // On the web this is not necessary because we can synchronously adjust the scroll in onContentSizeChange instead. const [deferParents, setDeferParents] = React.useState(isNative) + const currentDid = currentAccount?.did const threadModerationCache = React.useMemo(() => { const cache: ThreadModerationCache = new WeakMap() if (thread && moderationOpts) { @@ -167,8 +168,8 @@ export function PostThread({ if (!threadViewPrefs || !thread) return null return createThreadSkeleton( - sortThread(thread, threadViewPrefs, threadModerationCache), - hasSession, + sortThread(thread, threadViewPrefs, threadModerationCache, currentDid), + !!currentDid, treeView, threadModerationCache, hiddenRepliesState !== HiddenRepliesState.Hide, @@ -176,7 +177,7 @@ export function PostThread({ }, [ thread, preferences?.threadViewPrefs, - hasSession, + currentDid, treeView, threadModerationCache, hiddenRepliesState, |