mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
message_fetch: Don't allow undefined narrow term operands.
This commit is contained in:
@@ -349,10 +349,12 @@ export function load_messages(opts: MessageFetchOptions, attempt = 1): void {
|
|||||||
const sub = stream_data.get_sub_by_id_string(term.operand);
|
const sub = stream_data.get_sub_by_id_string(term.operand);
|
||||||
server_terms.push({
|
server_terms.push({
|
||||||
...term,
|
...term,
|
||||||
// If the sub is undefined, we'll get an error which is handled
|
// If we can't find the sub, we shouldn't send `undefined`
|
||||||
// later by showing a "this channel does not exist or is private"
|
// because we want to preserve the NarrowTerm type, so we just
|
||||||
// notice.
|
// send the unknown stream id.
|
||||||
operand: sub?.name,
|
// This should show a "this channel does not exist or is private"
|
||||||
|
// notice (both logged in and logged out).
|
||||||
|
operand: sub?.name ?? term.operand,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
server_terms.push({...term});
|
server_terms.push({...term});
|
||||||
|
|||||||
Reference in New Issue
Block a user