Merge branch 'dev' of https://lab.si.usi.ch/sa4-2020/the-sanmarinoes/frontend into dev
This commit is contained in:
commit
5433b5fd8d
1 changed files with 4 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue