Allow removing deleted quotes from composer (#36080)

This commit is contained in:
diondiondion authored and GitHub committed 2025-09-11 14:44:20 +00:00
1 parent 872044484c
commit 84d1ba980b
4 files changed
+140 -66

No files matched your search

@@ -11,7 +11,9 @@ export const ComposeQuotedStatus: FC = () => {
const quotedStatusId = useAppSelector(
(state) => state.compose.get('quoted_status_id') as string | null,
);
const isEditing = useAppSelector((state) => !!state.compose.get('id'));
const quote = useMemo(
() =>
quotedStatusId
@@ -22,16 +24,20 @@ export const ComposeQuotedStatus: FC = () => {
: null,
[quotedStatusId],
);
const dispatch = useAppDispatch();
const handleQuoteCancel = useCallback(() => {
dispatch(quoteComposeCancel());
}, [dispatch]);
if (!quote) {
return null;
}
return (
<QuotedStatus
quote={quote}
contextType='composer'
onQuoteCancel={!isEditing ? handleQuoteCancel : undefined}
/>
);