This commit is contained in:
britea 2020-05-05 17:57:10 +02:00
commit 5433b5fd8d

View file

@ -11,7 +11,6 @@ import {
import { connect } from "react-redux";
import { RemoteService, Forms } from "../remote";
import { appActions } from "../storeActions";
//import { update } from "immutability-helper";
class HostModal extends Component {
constructor(props) {
@ -23,7 +22,8 @@ class HostModal extends Component {
.then(() => {
this.setState({
...this.state,
guests: this.props.guests.map((u) => u.id),
guests: this.props.guests
.map((u) => u.id),
});
})
.catch(console.error);
@ -32,7 +32,7 @@ class HostModal extends Component {
.then((users) =>
this.setState({
...this.state,
users: users.map((u) => ({
users: users.filter(u => u.id !== this.props.currentUserId).map((u) => ({
key: u.id,
text: `@${u.username} (${u.name})`,
value: u.id,
@ -127,6 +127,7 @@ const setActiveHost = (activeHost) => {
const mapStateToProps = (state) => ({
guests: state.guests,
currentUserId: state.userInfo.id
});
const HostModalContainer = connect(
mapStateToProps,