Fixes for the team user lists in the system console (#4294)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
486d12e1c3
Коммит
e6d26bee51
@@ -205,7 +205,7 @@ class TeamStoreClass extends EventEmitter {
|
||||
}
|
||||
|
||||
getMembersInTeam(teamId = this.getCurrentId()) {
|
||||
return this.members_in_team[teamId] || {};
|
||||
return Object.assign({}, this.members_in_team[teamId]) || {};
|
||||
}
|
||||
|
||||
hasActiveMemberInTeam(teamId = this.getCurrentId(), userId) {
|
||||
|
||||
@@ -169,11 +169,12 @@ class UserStoreClass extends EventEmitter {
|
||||
// System-Wide Profiles
|
||||
|
||||
saveProfiles(profiles) {
|
||||
const newProfiles = Object.assign({}, profiles);
|
||||
const currentId = this.getCurrentId();
|
||||
if (profiles[currentId]) {
|
||||
Reflect.deleteProperty(profiles, currentId);
|
||||
if (newProfiles[currentId]) {
|
||||
Reflect.deleteProperty(newProfiles, currentId);
|
||||
}
|
||||
this.profiles = Object.assign({}, this.profiles, profiles);
|
||||
this.profiles = Object.assign({}, this.profiles, newProfiles);
|
||||
}
|
||||
|
||||
getProfiles() {
|
||||
@@ -331,6 +332,20 @@ class UserStoreClass extends EventEmitter {
|
||||
return profiles;
|
||||
}
|
||||
|
||||
removeProfileFromTeam(teamId, userId) {
|
||||
const userIds = this.profiles_in_team[teamId];
|
||||
if (!userIds) {
|
||||
return;
|
||||
}
|
||||
|
||||
const index = userIds.indexOf(userId);
|
||||
if (index === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
userIds.splice(index, 1);
|
||||
}
|
||||
|
||||
// Channel-Wide Profiles
|
||||
|
||||
saveProfilesInChannel(channelId = ChannelStore.getCurrentId(), profiles) {
|
||||
|
||||
Ссылка в новой задаче
Block a user