diff --git a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js index 50c36460c10..866ddebd955 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js +++ b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js @@ -45,6 +45,13 @@ export default Controller.extend({ inviteExpired: equal("filter", "expired"), invitePending: equal("filter", "pending"), + @discourseComputed("model") + hasEmailInvites(model) { + return model.invites.some((invite) => { + return invite.email; + }); + }, + @discourseComputed("filter") showBulkActionButtons(filter) { return ( @@ -57,9 +64,9 @@ export default Controller.extend({ canInviteToForum: reads("currentUser.can_invite_to_forum"), canBulkInvite: reads("currentUser.admin"), - @discourseComputed("invitesCount.total") - showSearch(invitesCountTotal) { - return invitesCountTotal > 0; + @discourseComputed("invitesCount", "filter") + showSearch(invitesCount, filter) { + return invitesCount[filter] > 5; }, @action diff --git a/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs b/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs index a3b616b4770..73eb1be6668 100644 --- a/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs +++ b/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs @@ -17,9 +17,9 @@ {{#if showBulkActionButtons}} {{#if inviteExpired}} {{#if removedAll}} -