Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

topic_generator: Fix types of get_next_stream, get_prev_stream.

Anders Kaseorg7377d3fab941
diff --git a/web/src/topic_generator.ts b/web/src/topic_generator.ts
index 01a26be2206..a830c1afeaf 100644
--- a/web/src/topic_generator.ts
+++ b/web/src/topic_generator.ts
@@ -164,7 +164,7 @@ export function get_next_unread_pm_string(curr_pm: string): string | undefined {
return undefined;
}
-export function get_next_stream(curr_stream: string): string {
+export function get_next_stream(curr_stream: string): string | undefined {
const my_streams = stream_list_sort.get_streams();
const curr_stream_index = my_streams.indexOf(curr_stream);
return my_streams[
@@ -174,7 +174,7 @@ export function get_next_stream(curr_stream: string): string {
];
}
-export function get_prev_stream(curr_stream: string): string {
+export function get_prev_stream(curr_stream: string): string | undefined {
const my_streams = stream_list_sort.get_streams();
const curr_stream_index = my_streams.indexOf(curr_stream);
return my_streams[curr_stream_index <= 0 ? my_streams.length - 1 : curr_stream_index - 1];