Skip to content

Commit

Permalink
compose: In quote-and-reply, set topic input when appropriate
Browse files Browse the repository at this point in the history
Fixes: zulip#5718
  • Loading branch information
chrisbobbe committed Apr 25, 2023
1 parent da9e9f9 commit a0c19b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compose/ComposeBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ const ComposeBox: React$AbstractComponent<Props, ImperativeHandle> = forwardRef(
return;
}

if (topicSelectionAllowed && topicInputState.value === '' && message.type === 'stream') {
// Later, this won't be necessary in the case of composing a new
// message. See TODO above about re-narrowing to `message`'s
// conversation.
setTopicInputValue(message.subject);
}
const quoteAndReplyText = getQuoteAndReplyText({
message,
rawContent,
Expand All @@ -454,6 +460,9 @@ const ComposeBox: React$AbstractComponent<Props, ImperativeHandle> = forwardRef(
setMessageInputValue,
zulipFeatureLevel,
_,
topicSelectionAllowed,
topicInputState.value,
setTopicInputValue,
messageInputRef,
],
);
Expand Down

0 comments on commit a0c19b0

Please sign in to comment.