FIX: Review sidebar link showing for users that can't review (#18454)
This commit is contained in:
parent
060123143f
commit
c5544a7624
|
@ -26,6 +26,7 @@ export default class ReviewSectionLink extends BaseSectionLink {
|
||||||
_refreshCanDisplay() {
|
_refreshCanDisplay() {
|
||||||
if (!this.currentUser.can_review) {
|
if (!this.currentUser.can_review) {
|
||||||
this.canDisplay = false;
|
this.canDisplay = false;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.inMoreDrawer) {
|
if (this.inMoreDrawer) {
|
||||||
|
|
|
@ -711,7 +711,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("review link is not shown when user cannot review", async function (assert) {
|
test("review link is not shown when user cannot review", async function (assert) {
|
||||||
updateCurrentUser({ can_review: false });
|
updateCurrentUser({ can_review: false, reviewable_count: 0 });
|
||||||
|
|
||||||
await visit("/");
|
await visit("/");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue