FIX: Leave group membership button not updating.
https://meta.discourse.org/t/leave-group-button-on-groups-page-doesnt-give-any-feedback/57359/4
This commit is contained in:
parent
65c000ad74
commit
bb85795934
|
@ -15,7 +15,7 @@ export default Ember.Component.extend({
|
|||
|
||||
@computed("model.is_group_user", "model.id", "groupUserIds")
|
||||
userIsGroupUser(isGroupUser, groupId, groupUserIds) {
|
||||
if (isGroupUser) {
|
||||
if (isGroupUser !== undefined) {
|
||||
return isGroupUser;
|
||||
} else {
|
||||
return !!groupUserIds && groupUserIds.includes(groupId);
|
||||
|
|
|
@ -58,4 +58,11 @@ test('userIsGroupUser', function() {
|
|||
this.subject().set('groupUserIds', undefined);
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), false);
|
||||
|
||||
this.subject().setProperties({
|
||||
groupUserIds: [1, 3],
|
||||
model: { id: 1, is_group_user: false }
|
||||
});
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), false);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue