Open Beacon24 opened 2 years ago
The Join button is always showing, regardless of whether or not the group has already been joined. This makes me think the first includes function is not finding the currentUser in the group members array. Code is pasted below:
includes
currentUser
members
<% if( group.members.includes('currentUser.name') ) { %> <form class="d-inline" action="/groups/<%= group._id%>/leave?_method=DELETE" method="POST"> <button class="btn btn-danger"> Leave </button> </form> <% } else { %> <form class="d-inline" action="/groups/<%= group._id%>/join" method="POST"> <button class="btn btn-danger"> Join </button> </form> <% } %>
This functionality has been temporarily hidden but it is still a problem worth working on, we will re-introduce this feature hopefully very soon.
The Join button is always showing, regardless of whether or not the group has already been joined. This makes me think the first
includes
function is not finding thecurrentUser
in the groupmembers
array. Code is pasted below: