DEV: attemps to limit Discourse.User.current() usage (#7943)

This commit is contained in:
Joffrey JAFFEUX
2019-07-26 11:20:11 +02:00
committed by GitHub
parent 0603636cea
commit fe7f0982af
14 changed files with 19 additions and 42 deletions

View File

@ -191,10 +191,9 @@ export default DropdownSelectBoxComponent.extend({
});
}
const currentUser = Discourse.User.current();
const showToggleTopicBump =
currentUser &&
(currentUser.get("staff") || currentUser.trust_level === 4);
this.get("currentUser.staff") ||
this.get("currentUser.trust_level") === 4;
if (action === REPLY && showToggleTopicBump) {
items.push({