From 0fb8c694c618203fbe11d3633617462410946485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Sat, 1 Nov 2025 13:10:39 +0100 Subject: [PATCH] pl-fe: improve nested quoted status indication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-api/lib/entities/status.ts | 2 ++ .../pl-fe/src/components/quoted-status-indicator.tsx | 12 +++++++----- packages/pl-fe/src/components/quoted-status.tsx | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/pl-api/lib/entities/status.ts b/packages/pl-api/lib/entities/status.ts index 50479e34c..f5985ea8a 100644 --- a/packages/pl-api/lib/entities/status.ts +++ b/packages/pl-api/lib/entities/status.ts @@ -152,6 +152,8 @@ const preprocess = (status: any) => { 'emoji_reactions', 'parent_visible', 'pinned_at', + 'quote_url', + 'quote_visible', 'quotes_count', 'bookmark_folder', 'list_id', diff --git a/packages/pl-fe/src/components/quoted-status-indicator.tsx b/packages/pl-fe/src/components/quoted-status-indicator.tsx index 66d951b41..7f054f5a5 100644 --- a/packages/pl-fe/src/components/quoted-status-indicator.tsx +++ b/packages/pl-fe/src/components/quoted-status-indicator.tsx @@ -8,20 +8,22 @@ import { makeGetStatus } from 'pl-fe/selectors'; interface IQuotedStatusIndicator { /** The quoted status id. */ - statusId: string; + statusId?: string; + /** The quoted status URL. */ + statusUrl?: string; } -const QuotedStatusIndicator: React.FC = ({ statusId }) => { +const QuotedStatusIndicator: React.FC = ({ statusId, statusUrl }) => { const getStatus = useCallback(makeGetStatus(), []); - const status = useAppSelector(state => getStatus(state, { id: statusId })); + statusUrl = useAppSelector(state => statusUrl || statusId && getStatus(state, { id: statusId })?.url); - if (!status) return null; + if (!statusUrl) return null; return ( - {status.url} + {statusUrl} ); }; diff --git a/packages/pl-fe/src/components/quoted-status.tsx b/packages/pl-fe/src/components/quoted-status.tsx index 14748a374..0edbed4e1 100644 --- a/packages/pl-fe/src/components/quoted-status.tsx +++ b/packages/pl-fe/src/components/quoted-status.tsx @@ -103,7 +103,7 @@ const QuotedStatus: React.FC = ({ status, onCancel, compose }) => isQuote /> - {status.quote_id && } + {status.quote_id && } {status.media_attachments.length > 0 && (