user_topics.js: Rename `visibility_policy_inherit` -> `inherit`.

This makes our frontend code less verbose, and makes this name
consistent with the names of other visibility policies (which
do not have the `VISIBILITY_POLICY` prefix).
This commit is contained in:
Abhijeet Prasad Bodas 2023-03-12 20:46:41 +05:30 committed by Tim Abbott
parent ae72777c77
commit 4d5e12961a
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import {get_time_from_date_muted} from "./util";
const muted_topics = new Map();
export const visibility_policy = {
VISIBILITY_POLICY_INHERIT: 0,
INHERIT: 0,
MUTED: 1,
UNMUTED: 2,
FOLLOWED: 3,
@ -74,7 +74,7 @@ export function set_user_topic(user_topic) {
case visibility_policy.MUTED:
add_muted_topic(stream_id, topic, date_muted);
break;
case visibility_policy.VISIBILITY_POLICY_INHERIT:
case visibility_policy.INHERIT:
remove_muted_topic(stream_id, topic);
break;
}

View File

@ -152,7 +152,7 @@ test("set_user_topics", () => {
stream_id: design.stream_id,
topic_name: "typography",
last_updated: "1577836800",
visibility_policy: visibility_policy.VISIBILITY_POLICY_INHERIT,
visibility_policy: visibility_policy.INHERIT,
});
assert.ok(!user_topics.is_topic_muted(design.stream_id, "typography"));
});