Remove user from list when selected in DM modal (#5884)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
2f15523fe8
Коммит
8dde651ded
@@ -111,7 +111,8 @@ export default class MultiSelect extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const options = this.props.options;
|
const options = Object.assign([], this.props.options);
|
||||||
|
const values = this.props.values;
|
||||||
|
|
||||||
let numRemainingText;
|
let numRemainingText;
|
||||||
if (this.props.numRemainingText) {
|
if (this.props.numRemainingText) {
|
||||||
@@ -142,6 +143,17 @@ export default class MultiSelect extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const valueMap = {};
|
||||||
|
for (let i = 0; i < values.length; i++) {
|
||||||
|
valueMap[values[i].id] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = options.length - 1; i >= 0; i--) {
|
||||||
|
if (valueMap[options[i].id]) {
|
||||||
|
options.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (options && options.length > this.props.perPage) {
|
if (options && options.length > this.props.perPage) {
|
||||||
const pageStart = this.state.page * this.props.perPage;
|
const pageStart = this.state.page * this.props.perPage;
|
||||||
const pageEnd = pageStart + this.props.perPage;
|
const pageEnd = pageStart + this.props.perPage;
|
||||||
|
|||||||
@@ -677,7 +677,10 @@ export default class Sidebar extends React.Component {
|
|||||||
<li key='more'>
|
<li key='more'>
|
||||||
<a
|
<a
|
||||||
href='#'
|
href='#'
|
||||||
onClick={() => this.showMoreDirectChannelsModal()}
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
this.showMoreDirectChannelsModal();
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='sidebar.moreElips'
|
id='sidebar.moreElips'
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user