toggle_resolve_topic: Display spinner while request is in progress.

We replace the check icon for "Mark as resolved/unresolved" with
a spinner while the request is still ongoing.

This helps to prevent double-clicking and reduce possible
race conditions.

Fixes #26190.
This commit is contained in:
Prakhar Pratyush
2023-09-16 13:10:07 +05:30
committed by Tim Abbott
parent 72b3a53864
commit 8d29ad7325
4 changed files with 34 additions and 4 deletions

View File

@@ -401,7 +401,7 @@ export function initialize() {
const $recipient_row = $(e.target).closest(".recipient_row");
const message_id = rows.id_for_recipient_row($recipient_row);
const topic_name = $(e.target).attr("data-topic-name");
message_edit.toggle_resolve_topic(message_id, topic_name);
message_edit.toggle_resolve_topic(message_id, topic_name, false, $recipient_row);
});
$("body").on("click", ".message_header .on_hover_topic_unresolve", (e) => {
@@ -409,7 +409,7 @@ export function initialize() {
const $recipient_row = $(e.target).closest(".recipient_row");
const message_id = rows.id_for_recipient_row($recipient_row);
const topic_name = $(e.target).attr("data-topic-name");
message_edit.toggle_resolve_topic(message_id, topic_name);
message_edit.toggle_resolve_topic(message_id, topic_name, false, $recipient_row);
});
// Mute topic in a unmuted stream