Small fixes and requireSignIn now working.
parent
5adb08e184
commit
f38c5e38c5
|
|
@ -1116,7 +1116,6 @@ export default class RoomClient
|
||||||
|
|
||||||
this._spotlights = new Spotlights(this._maxSpotlights, this._signalingSocket);
|
this._spotlights = new Spotlights(this._maxSpotlights, this._signalingSocket);
|
||||||
|
|
||||||
store.dispatch(stateActions.toggleJoined());
|
|
||||||
store.dispatch(stateActions.setRoomState('connecting'));
|
store.dispatch(stateActions.setRoomState('connecting'));
|
||||||
|
|
||||||
this._signalingSocket.on('connect', () =>
|
this._signalingSocket.on('connect', () =>
|
||||||
|
|
@ -1294,6 +1293,8 @@ export default class RoomClient
|
||||||
{
|
{
|
||||||
case 'enteredLobby':
|
case 'enteredLobby':
|
||||||
{
|
{
|
||||||
|
store.dispatch(stateActions.setInLobby(true));
|
||||||
|
|
||||||
const { displayName } = store.getState().settings;
|
const { displayName } = store.getState().settings;
|
||||||
|
|
||||||
await this.sendRequest('changeDisplayName', { displayName });
|
await this.sendRequest('changeDisplayName', { displayName });
|
||||||
|
|
@ -1302,18 +1303,14 @@ export default class RoomClient
|
||||||
|
|
||||||
case 'roomReady':
|
case 'roomReady':
|
||||||
{
|
{
|
||||||
|
store.dispatch(stateActions.toggleJoined());
|
||||||
|
store.dispatch(stateActions.setInLobby(false));
|
||||||
|
|
||||||
await this._joinRoom({ joinVideo });
|
await this._joinRoom({ joinVideo });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'roomLocked':
|
|
||||||
{
|
|
||||||
store.dispatch(stateActions.setRoomLockedOut());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'lockRoom':
|
case 'lockRoom':
|
||||||
{
|
{
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,11 @@ export const setRoomUnLocked = () =>
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setRoomLockedOut = () =>
|
export const setInLobby = (inLobby) =>
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
type : 'SET_ROOM_LOCKED_OUT'
|
type : 'SET_IN_LOBBY',
|
||||||
|
payload : { inLobby }
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,6 @@ const mapStateToProps = (state) =>
|
||||||
return {
|
return {
|
||||||
room : state.room,
|
room : state.room,
|
||||||
lobbyPeers : lobbyPeersKeySelector(state)
|
lobbyPeers : lobbyPeersKeySelector(state)
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const App = (props) =>
|
||||||
room
|
room
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (room.lockedOut)
|
if (room.inLobby)
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
<Lobby />
|
<Lobby />
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,6 @@ const JoinDialog = ({
|
||||||
classes
|
classes
|
||||||
}) =>
|
}) =>
|
||||||
{
|
{
|
||||||
const [ localDisplayName, setLocalDisplayName ] = useState(displayName);
|
|
||||||
|
|
||||||
const handleKeyDown = (event) =>
|
const handleKeyDown = (event) =>
|
||||||
{
|
{
|
||||||
const { key } = event;
|
const { key } = event;
|
||||||
|
|
@ -70,10 +68,8 @@ const JoinDialog = ({
|
||||||
case 'Enter':
|
case 'Enter':
|
||||||
case 'Escape':
|
case 'Escape':
|
||||||
{
|
{
|
||||||
if (localDisplayName !== '') // Don't allow empty displayName
|
if (displayName === '')
|
||||||
changeDisplayName(localDisplayName);
|
changeDisplayName('Guest');
|
||||||
else
|
|
||||||
setLocalDisplayName(displayName);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
@ -104,18 +100,18 @@ const JoinDialog = ({
|
||||||
id='displayname'
|
id='displayname'
|
||||||
label='Your name'
|
label='Your name'
|
||||||
className={classes.textField}
|
className={classes.textField}
|
||||||
value={localDisplayName}
|
value={displayName}
|
||||||
onChange={(event) =>
|
onChange={(event) =>
|
||||||
{
|
{
|
||||||
const { value } = event.target;
|
const { value } = event.target;
|
||||||
|
|
||||||
setLocalDisplayName(value);
|
changeDisplayName(value);
|
||||||
}}
|
}}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
onBlur={() =>
|
onBlur={() =>
|
||||||
{
|
{
|
||||||
if (localDisplayName !== displayName)
|
if (displayName === '')
|
||||||
changeDisplayName(localDisplayName);
|
changeDisplayName('Guest');
|
||||||
}}
|
}}
|
||||||
margin='normal'
|
margin='normal'
|
||||||
/>
|
/>
|
||||||
|
|
@ -193,7 +189,8 @@ export default withRoomContext(connect(
|
||||||
areStatesEqual : (next, prev) =>
|
areStatesEqual : (next, prev) =>
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
prev.settings.displayName === next.settings.displayName
|
prev.settings.displayName === next.settings.displayName &&
|
||||||
|
prev.me.loginEnabled === next.me.loginEnabled
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
import { withRoomContext } from '../RoomContext';
|
import { withRoomContext } from '../RoomContext';
|
||||||
import * as stateActions from '../actions/stateActions';
|
import * as stateActions from '../actions/stateActions';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import Dialog from '@material-ui/core/Dialog';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import Paper from '@material-ui/core/Paper';
|
import DialogActions from '@material-ui/core/DialogActions';
|
||||||
|
import Button from '@material-ui/core/Button';
|
||||||
|
import TextField from '@material-ui/core/TextField';
|
||||||
|
|
||||||
const styles = (theme) =>
|
const styles = (theme) =>
|
||||||
({
|
({
|
||||||
|
|
@ -49,27 +52,104 @@ const styles = (theme) =>
|
||||||
});
|
});
|
||||||
|
|
||||||
const Lobby = ({
|
const Lobby = ({
|
||||||
|
roomClient,
|
||||||
|
url,
|
||||||
|
displayName,
|
||||||
|
loginEnabled,
|
||||||
|
changeDisplayName,
|
||||||
classes
|
classes
|
||||||
}) =>
|
}) =>
|
||||||
{
|
{
|
||||||
|
const handleKeyDown = (event) =>
|
||||||
|
{
|
||||||
|
const { key } = event;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case 'Enter':
|
||||||
|
case 'Escape':
|
||||||
|
{
|
||||||
|
if (displayName === '')
|
||||||
|
changeDisplayName('Guest');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<Paper className={classes.message}>
|
<Dialog
|
||||||
<Typography variant='h2'>This room is locked at the moment, try again later.</Typography>
|
open
|
||||||
</Paper>
|
classes={{
|
||||||
|
paper : classes.dialogPaper
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{ window.config.logo &&
|
||||||
|
<img alt='Logo' className={classes.logo} src={window.config.logo} />
|
||||||
|
}
|
||||||
|
<Typography variant='h2' align='center'>
|
||||||
|
Virtual lobby
|
||||||
|
</Typography>
|
||||||
|
<Typography variant='h6'>
|
||||||
|
You are currently in the virtual lobby of: {url}
|
||||||
|
Please wait for someone to let you in.
|
||||||
|
</Typography>
|
||||||
|
<TextField
|
||||||
|
id='displayname'
|
||||||
|
label='Your name'
|
||||||
|
className={classes.textField}
|
||||||
|
value={displayName}
|
||||||
|
onChange={(event) =>
|
||||||
|
{
|
||||||
|
const { value } = event.target;
|
||||||
|
|
||||||
|
changeDisplayName(value);
|
||||||
|
}}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
onBlur={() =>
|
||||||
|
{
|
||||||
|
if (displayName === '')
|
||||||
|
changeDisplayName('Guest');
|
||||||
|
}}
|
||||||
|
margin='normal'
|
||||||
|
/>
|
||||||
|
<DialogActions>
|
||||||
|
{ loginEnabled &&
|
||||||
|
<Button
|
||||||
|
onClick={() =>
|
||||||
|
{
|
||||||
|
roomClient.login();
|
||||||
|
}}
|
||||||
|
variant='contained'
|
||||||
|
color='secondary'
|
||||||
|
>
|
||||||
|
Sign in
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Lobby.propTypes =
|
Lobby.propTypes =
|
||||||
{
|
{
|
||||||
classes : PropTypes.object.isRequired
|
roomClient : PropTypes.any.isRequired,
|
||||||
|
url : PropTypes.string.isRequired,
|
||||||
|
displayName : PropTypes.string.isRequired,
|
||||||
|
loginEnabled : PropTypes.string.isRequired,
|
||||||
|
changeDisplayName : PropTypes.func.isRequired,
|
||||||
|
classes : PropTypes.object.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) =>
|
const mapStateToProps = (state) =>
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
displayName : state.settings.displayName
|
url : state.room.url,
|
||||||
|
displayName : state.settings.displayName,
|
||||||
|
loginEnabled : state.me.loginEnabled
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -91,7 +171,9 @@ export default withRoomContext(connect(
|
||||||
areStatesEqual : (next, prev) =>
|
areStatesEqual : (next, prev) =>
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
prev.settings.displayName === next.settings.displayName
|
prev.room.url === next.room.url &&
|
||||||
|
prev.settings.displayName === next.settings.displayName &&
|
||||||
|
prev.me.loginEnabled === next.me.loginEnabled
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import {
|
||||||
|
lobbyPeersKeySelector
|
||||||
|
} from './Selectors';
|
||||||
import * as appPropTypes from './appPropTypes';
|
import * as appPropTypes from './appPropTypes';
|
||||||
import { withRoomContext } from '../RoomContext';
|
import { withRoomContext } from '../RoomContext';
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
|
|
@ -29,8 +32,7 @@ import VideoWindow from './VideoWindow/VideoWindow';
|
||||||
import FullScreenIcon from '@material-ui/icons/Fullscreen';
|
import FullScreenIcon from '@material-ui/icons/Fullscreen';
|
||||||
import FullScreenExitIcon from '@material-ui/icons/FullscreenExit';
|
import FullScreenExitIcon from '@material-ui/icons/FullscreenExit';
|
||||||
import SettingsIcon from '@material-ui/icons/Settings';
|
import SettingsIcon from '@material-ui/icons/Settings';
|
||||||
import LockIcon from '@material-ui/icons/Lock';
|
import SecurityIcon from '@material-ui/icons/Security';
|
||||||
import LockOpenIcon from '@material-ui/icons/LockOpen';
|
|
||||||
import LockDialog from './AccessControl/LockDialog/LockDialog';
|
import LockDialog from './AccessControl/LockDialog/LockDialog';
|
||||||
import Button from '@material-ui/core/Button';
|
import Button from '@material-ui/core/Button';
|
||||||
import Settings from './Settings/Settings';
|
import Settings from './Settings/Settings';
|
||||||
|
|
@ -258,6 +260,7 @@ class Room extends React.PureComponent
|
||||||
const {
|
const {
|
||||||
roomClient,
|
roomClient,
|
||||||
room,
|
room,
|
||||||
|
lobbyPeers,
|
||||||
advancedMode,
|
advancedMode,
|
||||||
myPicture,
|
myPicture,
|
||||||
loggedIn,
|
loggedIn,
|
||||||
|
|
@ -327,7 +330,12 @@ class Room extends React.PureComponent
|
||||||
color='inherit'
|
color='inherit'
|
||||||
onClick={() => setLockDialogOpen(!room.lockDialogOpen)}
|
onClick={() => setLockDialogOpen(!room.lockDialogOpen)}
|
||||||
>
|
>
|
||||||
{ room.locked ? <LockIcon /> : <LockOpenIcon /> }
|
<PulsingBadge
|
||||||
|
color='secondary'
|
||||||
|
badgeContent={lobbyPeers.length}
|
||||||
|
>
|
||||||
|
<SecurityIcon />
|
||||||
|
</PulsingBadge>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
{ this.fullscreen.fullscreenEnabled &&
|
{ this.fullscreen.fullscreenEnabled &&
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|
@ -411,6 +419,7 @@ Room.propTypes =
|
||||||
{
|
{
|
||||||
roomClient : PropTypes.object.isRequired,
|
roomClient : PropTypes.object.isRequired,
|
||||||
room : appPropTypes.Room.isRequired,
|
room : appPropTypes.Room.isRequired,
|
||||||
|
lobbyPeers : PropTypes.array,
|
||||||
advancedMode : PropTypes.bool.isRequired,
|
advancedMode : PropTypes.bool.isRequired,
|
||||||
myPicture : PropTypes.string,
|
myPicture : PropTypes.string,
|
||||||
loggedIn : PropTypes.bool.isRequired,
|
loggedIn : PropTypes.bool.isRequired,
|
||||||
|
|
@ -428,6 +437,7 @@ Room.propTypes =
|
||||||
const mapStateToProps = (state) =>
|
const mapStateToProps = (state) =>
|
||||||
({
|
({
|
||||||
room : state.room,
|
room : state.room,
|
||||||
|
lobbyPeers : lobbyPeersKeySelector(state),
|
||||||
advancedMode : state.settings.advancedMode,
|
advancedMode : state.settings.advancedMode,
|
||||||
loggedIn : state.me.loggedIn,
|
loggedIn : state.me.loggedIn,
|
||||||
loginEnabled : state.me.loginEnabled,
|
loginEnabled : state.me.loginEnabled,
|
||||||
|
|
@ -466,6 +476,7 @@ export default withRoomContext(connect(
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
prev.room === next.room &&
|
prev.room === next.room &&
|
||||||
|
prev.lobbyPeers === next.lobbyPeers &&
|
||||||
prev.me.loggedIn === next.me.loggedIn &&
|
prev.me.loggedIn === next.me.loggedIn &&
|
||||||
prev.me.loginEnabled === next.me.loginEnabled &&
|
prev.me.loginEnabled === next.me.loginEnabled &&
|
||||||
prev.settings.picture === next.settings.picture &&
|
prev.settings.picture === next.settings.picture &&
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import * as serviceWorker from './serviceWorker';
|
||||||
|
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'production')
|
if (process.env.REACT_APP_DEBUG === '*')
|
||||||
{
|
{
|
||||||
debug.enable('* -engine* -socket* -RIE* *WARN* *ERROR*');
|
debug.enable('* -engine* -socket* -RIE* *WARN* *ERROR*');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ const initialState =
|
||||||
url : null,
|
url : null,
|
||||||
state : 'new', // new/connecting/connected/disconnected/closed,
|
state : 'new', // new/connecting/connected/disconnected/closed,
|
||||||
locked : false,
|
locked : false,
|
||||||
lockedOut : false,
|
enteredLobby : false,
|
||||||
accessCode : '', // access code to the room if locked and joinByAccessCode == true
|
accessCode : '', // access code to the room if locked and joinByAccessCode == true
|
||||||
joinByAccessCode : true, // if true: accessCode is a possibility to open the room
|
joinByAccessCode : true, // if true: accessCode is a possibility to open the room
|
||||||
activeSpeakerId : null,
|
activeSpeakerId : null,
|
||||||
|
|
@ -51,9 +51,11 @@ const room = (state = initialState, action) =>
|
||||||
return { ...state, locked: false };
|
return { ...state, locked: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'SET_ROOM_LOCKED_OUT':
|
case 'SET_IN_LOBBY':
|
||||||
{
|
{
|
||||||
return { ...state, lockedOut: true };
|
const { inLobby } = action.payload;
|
||||||
|
|
||||||
|
return { ...state, inLobby };
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'SET_ACCESS_CODE':
|
case 'SET_ACCESS_CODE':
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue