topic_edit: Fix resolve topic notification.

When 'resolve|unresolve' and 'change topic' actions occurs in
the same api call using 'topic sidebar icon', only 'topic_moved'
notification is sent.

Both 'topic moved' and 'topic resolved' notification should be generated.

Currently, 'select_stream_id' is not set to 'undefined',
even if we only change 'topic name' and/or 'resolve|unresolve' topic.
Resulting in no 'resolved_topic' notification.

This commit sets 'select_stream_id' to 'undefined' to fix the issue.
This commit is contained in:
Prakhar Pratyush
2022-12-16 10:08:20 +05:30
committed by Tim Abbott
parent 01961b4282
commit 62437e6930

View File

@@ -474,16 +474,17 @@ export function build_move_topic_to_stream_popover(current_stream_id, topic_name
// there has been no change in the topic name.
new_topic_name = undefined;
}
if (select_stream_id === current_stream_id) {
// We use `undefined` to tell the server that
// there has been no change in stream. This is
// important for cases when changing stream is
// not allowed or when changes other than
// stream-change has been made.
select_stream_id = undefined;
}
let propagate_mode = "change_all";
if (message !== undefined) {
if (select_stream_id === current_stream_id) {
// We use `undefined` to tell the server that
// there has been no change in stream. This is
// important for cases when changing stream is
// not allowed.
select_stream_id = undefined;
}
// We already have the message_id here which means that modal is opened using
// message popover.
propagate_mode = $("#move_topic_modal select.message_edit_topic_propagate").val();
@@ -503,7 +504,7 @@ export function build_move_topic_to_stream_popover(current_stream_id, topic_name
current_stream_id,
old_topic_name,
(message_id) => {
if (old_topic_name && select_stream_id) {
if (old_topic_name) {
message_edit.move_topic_containing_message_to_stream(
message_id,
select_stream_id,