mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
message_edit: Fix 'stream_and_topic_exist_in_edit_history' for topic="".
This commit fixes the 'stream_and_topic_exist_in_edit_history' function for empty string topic. Earlier, `if` statements were not checking toipc===undefined explicitly resulting in buggy behaviour when topic="".
This commit is contained in:
committed by
Tim Abbott
parent
08b1ec7b55
commit
82646c4d96
@@ -311,7 +311,7 @@ export function stream_and_topic_exist_in_edit_history(
|
||||
}
|
||||
|
||||
for (const edit_history_event of message.edit_history) {
|
||||
if (!edit_history_event.prev_stream && !edit_history_event.prev_topic) {
|
||||
if (!edit_history_event.prev_stream && edit_history_event.prev_topic === undefined) {
|
||||
// Message was not moved in this edit event.
|
||||
continue;
|
||||
}
|
||||
@@ -324,7 +324,7 @@ export function stream_and_topic_exist_in_edit_history(
|
||||
message_dict.stream_id = edit_history_event.prev_stream;
|
||||
}
|
||||
|
||||
if (edit_history_event.prev_topic) {
|
||||
if (edit_history_event.prev_topic !== undefined) {
|
||||
// This edit event changed the topic. We expect the
|
||||
// following to be true due to the invariants of the edit
|
||||
// history data structure:
|
||||
|
||||
Reference in New Issue
Block a user