diff --git a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js index 1b222ab39356..39545fce6e9e 100644 --- a/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js +++ b/packages/rocketchat-channel-settings/client/lib/ChannelSettings.js @@ -21,12 +21,13 @@ RocketChat.ChannelSettings = new class { }); } - getOptions(currentData, group) { + getOptions(currentData = {}, group) { const allOptions = _.toArray(this.options.get()); const allowedOptions = _.compact(_.map(allOptions, function(option) { + const ret = {...option}; if (option.validation == null || option.validation()) { - option.data = Object.assign({}, typeof option.data === 'function' ? option.data() : option.data, currentData); - return option; + ret.data = Object.assign({}, typeof option.data === 'function' ? option.data() : option.data, currentData); + return ret; } })).filter(function(option) { return !group || !option.group || option.group.includes(group); diff --git a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js index 9c8d75fd9f0d..260a1ed42c55 100644 --- a/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js +++ b/packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.js @@ -19,7 +19,7 @@ Template.adminRoomInfo.helpers({ return room && room.t; }, channelSettings() { - return RocketChat.ChannelSettings.getOptions(Session.get('adminRoomsSelected'), 'admin-room'); + return RocketChat.ChannelSettings.getOptions(undefined, 'admin-room'); }, roomTypeDescription() { const room = AdminChatRoom.findOne(this.rid, { fields: { t: 1 } });