Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

spectators: Fix double modal bug with message edit history.

Tim Abbott362761757b60
diff --git a/static/js/message_edit_history.js b/static/js/message_edit_history.js
index 8623ec721e5..fbe79fd4d86 100644
--- a/static/js/message_edit_history.js
+++ b/static/js/message_edit_history.js
@@ -13,6 +13,7 @@ import * as people from "./people";
import * as popovers from "./popovers";
import * as rendered_markdown from "./rendered_markdown";
import * as rows from "./rows";
+import * as spectators from "./spectators";
import * as stream_data from "./stream_data";
import * as sub_store from "./sub_store";
import * as timerender from "./timerender";
@@ -176,16 +177,22 @@ export function initialize() {
});
$("body").on("click", ".message_edit_notice", (e) => {
+ e.stopPropagation();
+ e.preventDefault();
popovers.hide_all();
+
const message_id = rows.id($(e.currentTarget).closest(".message_row"));
const $row = message_lists.current.get_row(message_id);
const message = message_lists.current.get(rows.id($row));
+ if (page_params.is_spectator) {
+ spectators.login_to_access();
+ return;
+ }
+
if (page_params.realm_allow_edit_history) {
show_history(message);
$("#message-history-cancel").trigger("focus");
}
- e.stopPropagation();
- e.preventDefault();
});
}