Skip to content

Commit

Permalink
More tweaking logic around default comment visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 25, 2024
1 parent 0015dba commit b36b7d9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7148,6 +7148,8 @@ function cmt_visibility_change() {
}
if (vis.value === "au" && would_auvis) {
form.elements.bsubmit.textContent = "Save and notify authors";
} else if (vis.value === "au") {
form.elements.bsubmit.textContent = "Save for authors";
} else {
form.elements.bsubmit.textContent = "Save";
}
Expand Down Expand Up @@ -7788,10 +7790,16 @@ function add_new_comment(cj, cid) {
document.querySelector(".pcontainer").insertBefore($e("article", {
id: cid, class: "pcard cmtcard cmtid comment view need-anchor-unfold has-fold ".concat(cj.collapsed ? "fold20c" : "fold20o", cj.editable ? " editable" : "")
}), $$("k-comment-actions"));
if (!cj.is_new && !cj.response && (!my_last_topic || cj.viewer_owned)) {
last_visibility = cj.visibility;
last_topic = cj.topic || "rev";
my_last_topic = cj.viewer_owned;
if (!cj.is_new && !cj.response) {
if (!my_last_topic || cj.viewer_owned) {
last_topic = cj.topic || "rev";
my_last_topic = cj.viewer_owned;
}
if (cj.viewer_owned) {
last_visibility = cj.visibility;
} else if (cj.visibility !== "au") {
last_visibility = cj.visibility === "admin" ? "rev" : cj.visibility;
}
}
}

Expand Down

0 comments on commit b36b7d9

Please sign in to comment.