Skip to content

Commit 468ac71

Browse files
chrisbobbegnprice
authored andcommitted
api [nfc]: Use kFooBar naming instead of FOO_BAR, for constants
1 parent 51a4ecb commit 468ac71

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/api/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
*/
1010
// This is hardcoded in the server, and therefore untranslated; that's
1111
// zulip/zulip#3639.
12-
export const NO_TOPIC_TOPIC: string = '(no topic)';
12+
export const kNoTopicTopic: string = '(no topic)';

src/compose/ComposeBox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export default function ComposeBox(props: Props): Node {
362362
const destinationNarrow = useMemo(() => {
363363
if (isStreamNarrow(narrow) || (isTopicNarrow(narrow) && isEditing)) {
364364
const streamId = streamIdOfNarrow(narrow);
365-
const topic = topicInputState.value.trim() || apiConstants.NO_TOPIC_TOPIC;
365+
const topic = topicInputState.value.trim() || apiConstants.kNoTopicTopic;
366366
return topicNarrow(streamId, topic);
367367
}
368368
invariant(isConversationNarrow(narrow), 'destination narrow must be conversation');
@@ -376,7 +376,7 @@ export default function ComposeBox(props: Props): Node {
376376

377377
if (
378378
isTopicNarrow(destinationNarrow)
379-
&& topicOfNarrow(destinationNarrow) === apiConstants.NO_TOPIC_TOPIC
379+
&& topicOfNarrow(destinationNarrow) === apiConstants.kNoTopicTopic
380380
&& mandatoryTopics
381381
) {
382382
result.push('mandatory-topic-empty');

src/sharing/ShareWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class ShareWrapperInner extends React.Component<Props, State> {
176176
: {
177177
content: messageToSend,
178178
type: 'stream',
179-
subject: sendTo.topic || apiConstants.NO_TOPIC_TOPIC,
179+
subject: sendTo.topic || apiConstants.kNoTopicTopic,
180180
// TODO(server-2.0): switch to numeric stream ID (#3918), not name;
181181
// then drop streamName from SendTo
182182
to: sendTo.streamName,

src/utils/__tests__/narrow-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ describe('getNarrowsForMessage', () => {
267267
//
268268
// We don't store outbox messages with the empty string for
269269
// `subject`; if the topic input is left blank, we put down
270-
// `apiConstants.NO_TOPIC_TOPIC` for `subject`.
270+
// `apiConstants.kNoTopicTopic` for `subject`.
271271
label: 'Message in a stream with empty-string topic',
272272
message: {
273273
...eg.streamMessage({ stream: eg.stream }),

0 commit comments

Comments
 (0)