@@ -186,7 +186,15 @@ export default function Message(props: Readonly<Props>) {
186
186
187
187
const submitMentionsRef = useRef < SubmitMentionsFn > ( ) ;
188
188
189
- const [ replying , setReplying ] = useState < boolean > ( false ) ;
189
+ const [ replying , setReplying ] = useState < boolean > ( ( ) => {
190
+ return (
191
+ props . actions ?. syncdb ?. get_one ( {
192
+ event : "draft" ,
193
+ sender_id : props . account_id ,
194
+ date : - date ,
195
+ } ) != null
196
+ ) ;
197
+ } ) ;
190
198
191
199
const replyMessageRef = useRef < string > ( "" ) ;
192
200
const replyMentionsRef = useRef < SubmitMentionsFn > ( ) ;
@@ -484,19 +492,6 @@ export default function Message(props: Readonly<Props>) {
484
492
</ Popconfirm >
485
493
</ Tooltip >
486
494
) : undefined }
487
- { /* {!is_thread_body && props.allowReply && !replying ? (
488
- <Button
489
- type="text"
490
- disabled={replying}
491
- style={{
492
- color: is_viewers_message ? "white" : "#555",
493
- }}
494
- size="small"
495
- onClick={() => setReplying(true)}
496
- >
497
- <Icon name="reply" /> Reply
498
- </Button>
499
- ) : undefined} */ }
500
495
{ message . get ( "history" ) . size > 1 ||
501
496
message . get ( "editing" ) . size > 0
502
497
? editing_status ( isEditing )
@@ -659,20 +654,25 @@ export default function Message(props: Readonly<Props>) {
659
654
placeholder = { "Reply to the above message..." }
660
655
/>
661
656
< div style = { { margin : "5px 0" } } >
662
- < Button
663
- onClick = { sendReply }
664
- type = "primary"
665
- style = { { marginRight : "5px" } }
666
- >
667
- < Icon name = "paper-plane" /> Send Reply
668
- </ Button >
669
657
< Button
670
658
onClick = { ( ) => {
671
659
setReplying ( false ) ;
660
+ props . actions ?. syncdb ?. delete ( {
661
+ event : "draft" ,
662
+ sender_id : props . account_id ,
663
+ date : - date ,
664
+ } ) ;
672
665
} }
673
666
>
674
667
Cancel
675
668
</ Button >
669
+ < Button
670
+ onClick = { sendReply }
671
+ type = "primary"
672
+ style = { { marginRight : "5px" } }
673
+ >
674
+ < Icon name = "paper-plane" /> Send Reply
675
+ </ Button >
676
676
< LLMCostEstimationChat
677
677
llm_cost = { llm_cost_reply }
678
678
compact = { false }
0 commit comments