topic_generator: Fix types of get_next_stream, get_prev_stream.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-05-29 18:57:56 -07:00 committed by Anders Kaseorg
parent c20af83770
commit 7377d3fab9
1 changed files with 2 additions and 2 deletions

View File

@ -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];