FIX: Review sidebar link showing for users that can't review (#18454)

This commit is contained in:
Alan Guo Xiang Tan 2022-10-03 16:59:25 +08:00 committed by GitHub
parent 060123143f
commit c5544a7624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@ export default class ReviewSectionLink extends BaseSectionLink {
_refreshCanDisplay() {
if (!this.currentUser.can_review) {
this.canDisplay = false;
return;
}
if (this.inMoreDrawer) {

View File

@ -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) {
updateCurrentUser({ can_review: false });
updateCurrentUser({ can_review: false, reviewable_count: 0 });
await visit("/");