From e542f0a52e05ee5d9f658468c33d5034d5ec53f0 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 11 Dec 2022 01:46:14 +0100 Subject: [PATCH] Fixed #534 --- src/components/Timeline/Default.tsx | 1 + src/components/Timeline/Shared/Content.tsx | 6 +++--- src/components/Timeline/Shared/Context.tsx | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Timeline/Default.tsx b/src/components/Timeline/Default.tsx index cf57785b..16c8ac90 100644 --- a/src/components/Timeline/Default.tsx +++ b/src/components/Timeline/Default.tsx @@ -125,6 +125,7 @@ const TimelineDefault: React.FC = ({ spoilerHidden, copiableContent, highlighted, + inThread: queryKey?.[1].page === 'Toot', disableDetails, disableOnPress }} diff --git a/src/components/Timeline/Shared/Content.tsx b/src/components/Timeline/Shared/Content.tsx index 0c187cee..85985330 100644 --- a/src/components/Timeline/Shared/Content.tsx +++ b/src/components/Timeline/Shared/Content.tsx @@ -11,7 +11,7 @@ export interface Props { } const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoilerExpanded }) => { - const { status, highlighted, disableDetails } = useContext(StatusContext) + const { status, highlighted, inThread, disableDetails } = useContext(StatusContext) if (!status || typeof status.content !== 'string' || !status.content.length) return null const { t } = useTranslation('componentTimeline') @@ -40,7 +40,7 @@ const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoi mentions={status.mentions} tags={status.tags} numberOfLines={ - instanceAccount.preferences['reading:expand:spoilers'] + instanceAccount.preferences['reading:expand:spoilers'] || inThread ? notificationOwnToot ? 2 : 999 @@ -60,7 +60,7 @@ const TimelineContent: React.FC = ({ notificationOwnToot = false, setSpoi emojis={status.emojis} mentions={status.mentions} tags={status.tags} - numberOfLines={highlighted ? 999 : notificationOwnToot ? 2 : undefined} + numberOfLines={highlighted || inThread ? 999 : notificationOwnToot ? 2 : undefined} disableDetails={disableDetails} /> )} diff --git a/src/components/Timeline/Shared/Context.tsx b/src/components/Timeline/Shared/Context.tsx index 5dafee11..7a4db11e 100644 --- a/src/components/Timeline/Shared/Context.tsx +++ b/src/components/Timeline/Shared/Context.tsx @@ -16,6 +16,7 @@ type ContextType = { }> highlighted?: boolean + inThread?: boolean disableDetails?: boolean disableOnPress?: boolean }