mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
scheduled_messages_feed_ui: Refactor to avoid duplicate function calls.
While this logic might seem to be different, util.same_stream_and_topic would always return false when passed a topic of undefined.
This commit is contained in:
@@ -33,12 +33,14 @@ function get_scheduled_messages_matching_narrow() {
|
||||
return true;
|
||||
}
|
||||
} else if (scheduled_message.type === "stream") {
|
||||
if (narrow_state.stream_sub() === undefined) {
|
||||
const current_stream = narrow_state.stream_sub();
|
||||
const current_topic = narrow_state.topic();
|
||||
if (current_stream === undefined || current_topic === undefined) {
|
||||
return false;
|
||||
}
|
||||
const narrow_dict = {
|
||||
stream_id: narrow_state.stream_sub().stream_id,
|
||||
topic: narrow_state.topic(),
|
||||
stream_id: current_stream.stream_id,
|
||||
topic: current_topic,
|
||||
};
|
||||
const scheduled_message_dict = {
|
||||
stream_id: scheduled_message.to,
|
||||
|
||||
Reference in New Issue
Block a user