Skip to content

Commit

Permalink
Fix value of topic selector when editing comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 17, 2024
1 parent 943d77a commit 4779154
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7230,7 +7230,7 @@ function cmt_start_edit(celt, cj) {
.on("hotcrprenderpreview", cmt_render_preview)
.autogrow();

var vis = cj.visibility
const vis = cj.visibility
|| last_visibility
|| (cj.by_author && "au")
|| (hotcrp.status.myperm.some_external_reviewer_can_view_comment === false && "pc")
Expand All @@ -7239,10 +7239,9 @@ function cmt_start_edit(celt, cj) {
.attr("data-default-value", vis)
.on("change", cmt_visibility_change);

const topic = cj.topic
|| last_topic
|| (document.querySelector(".revcard") ? "rev" : "paper");
if (topic !== "rev") {
const new_topic = last_topic || (document.querySelector(".revcard") ? "rev" : "paper"),
topic = cj.is_new ? new_topic : cj.topic || "rev";
if (topic !== "rev" || new_topic !== "rev") {
fold(celt.querySelector(".cmteditinfo"), false, 4);
}
$(form.elements.topic).val(topic)
Expand Down

0 comments on commit 4779154

Please sign in to comment.