diff --git a/src/App.tsx b/src/App.tsx index 79dafc5..1db6007 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1151,7 +1151,11 @@ export const App = () => { account={composeAccount} api={services.api} onSubmit={handleSubmit} - replyingTo={replyTarget ? { id: replyTarget.id, summary: replySummary ?? "" } : null} + replyingTo={ + replyTarget + ? { id: replyTarget.id, summary: replySummary ?? "", spoilerText: replyTarget.spoilerText } + : null + } onCancelReply={() => { setReplyTarget(null); setMentionSeed(null); @@ -1343,7 +1347,11 @@ export const App = () => { composeAccountSelector={composeAccountSelector} api={services.api} onSubmit={handleSubmit} - replyingTo={replyTarget ? { id: replyTarget.id, summary: replySummary ?? "" } : null} + replyingTo={ + replyTarget + ? { id: replyTarget.id, summary: replySummary ?? "", spoilerText: replyTarget.spoilerText } + : null + } onCancelReply={() => { setReplyTarget(null); setMentionSeed(null); diff --git a/src/ui/components/ComposeBox.tsx b/src/ui/components/ComposeBox.tsx index 67e947c..7dd849b 100644 --- a/src/ui/components/ComposeBox.tsx +++ b/src/ui/components/ComposeBox.tsx @@ -49,7 +49,7 @@ export const ComposeBox = ({ files: File[]; spoilerText: string; }) => Promise; - replyingTo: { id: string; summary: string } | null; + replyingTo: { id: string; summary: string; spoilerText: string } | null; onCancelReply: () => void; mentionText: string | null; accountSelector?: React.ReactNode; @@ -302,6 +302,21 @@ export const ComposeBox = ({ } }, [mentionText]); + useEffect(() => { + if (!replyingTo) { + setCwEnabled(false); + setCwText(""); + return; + } + if (!replyingTo.spoilerText) { + setCwEnabled(false); + setCwText(""); + return; + } + setCwEnabled(true); + setCwText(replyingTo.spoilerText); + }, [replyingTo?.id, replyingTo?.spoilerText]); + // 이모지 패널이 열리면 이모지 로드 useEffect(() => { if (emojiPanelOpen && account) { diff --git a/src/ui/components/MobileMenus.tsx b/src/ui/components/MobileMenus.tsx index 81b3992..1efb959 100644 --- a/src/ui/components/MobileMenus.tsx +++ b/src/ui/components/MobileMenus.tsx @@ -18,7 +18,7 @@ type MobileComposeMenuProps = { files: File[]; spoilerText: string; }) => Promise; - replyingTo: { id: string; summary: string } | null; + replyingTo: { id: string; summary: string; spoilerText: string } | null; onCancelReply: () => void; mentionText: string | null; };