Skip to content

Commit

Permalink
Fix users loading on group click and group creation on select
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Mar 2, 2018
1 parent e0c54c8 commit e8df148
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion settings/js/users/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ GroupList = {
filterGroups: false,

addGroup: function (gid, displayName, usercount) {
if (_.isUndefined(displayName)) {
displayName = gid;
}
var $li = $userGroupList.find('.isgroup:last-child').clone();
$li
.data('gid', gid)
Expand Down Expand Up @@ -142,7 +145,7 @@ GroupList = {
function (result) {
if (result.groupname) {
var addedGroup = result.groupname;
UserList.availableGroups[result.id] = {displayName: result.groupName};
UserList.availableGroups[groupid] = {displayName: result.groupname};
GroupList.addGroup(groupid, result.groupname);
}
GroupList.toggleAddGroup();
Expand Down
3 changes: 1 addition & 2 deletions settings/js/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var UserList = {
* }
*/
add: function (user) {
if (this.currentGid && this.currentGid !== '_everyone' && this.currentGid !== '_disabledUsers' && _.indexOf(user.groups, this.currentGid) < 0) {
if (this.currentGid && this.currentGid !== '_everyone' && this.currentGid !== '_disabledUsers' && Object.keys(user.groups).indexOf(this.currentGid) < 0) {
return false;
}

Expand Down Expand Up @@ -442,7 +442,6 @@ var UserList = {
if (!OC.isUserAdmin() && checked.length === 1 && checked[0] === group) {
return false;
}

if (add && OC.isUserAdmin() && _.isUndefined(UserList.availableGroups[group])) {
GroupList.createGroup(group);
if (_.isUndefined(UserList.availableGroups[group])) {
Expand Down

0 comments on commit e8df148

Please sign in to comment.