Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display topic input only in stream narrow #945

Merged
merged 1 commit into from
Jul 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compose/ComposeBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ComposeBox extends PureComponent {
return (
<View style={this.context.styles.composeBox}>
<AutoCompleteView text={text} onAutocomplete={this.handleAutoComplete} />
{(isTopicNarrow(narrow) || isStreamNarrow(narrow)) &&
{isStreamNarrow(narrow) &&
<View style={styles.topicWrapper}>
<StreamBox
optionSelected={optionSelected}
Expand Down
24 changes: 10 additions & 14 deletions src/compose/ComposeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,16 @@ export default class ComposeText extends PureComponent {

if (isPrivateOrGroupNarrow(narrow)) {
sendMessage(auth, 'private', narrow[0].operand, '', text);
} else if (isTopicNarrow(narrow) || isStreamNarrow(narrow)) {
if (operator !== null) {
sendMessage(
auth,
'stream',
narrow[0].operand,
operator === '' ? '(no topic)' : operator,
text,
);
} else if (isTopicNarrow(narrow)) {
sendMessage(auth, 'stream', narrow[0].operand, narrow[1].operand, text);
} else if (isStreamNarrow(narrow)) {
sendMessage(auth, 'stream', narrow[0].operand, '(no topic)', text);
}
} else if (isStreamNarrow(narrow)) {
sendMessage(
auth,
'stream',
narrow[0].operand,
operator === '' ? '(no topic)' : operator,
text,
);
} else if (isTopicNarrow(narrow)) {
sendMessage(auth, 'stream', narrow[0].operand, narrow[1].operand, text);
}

this.clearInput();
Expand Down