Show avatar when logged in and support logging out
This commit is contained in:
@@ -23,7 +23,8 @@ const initialState =
|
||||
restartIceInProgress : false,
|
||||
picture : null,
|
||||
selectedWebcam : null,
|
||||
selectedAudioDevice : null
|
||||
selectedAudioDevice : null,
|
||||
loggedIn : false
|
||||
};
|
||||
|
||||
const me = (state = initialState, action) =>
|
||||
@@ -50,6 +51,12 @@ const me = (state = initialState, action) =>
|
||||
};
|
||||
}
|
||||
|
||||
case 'LOGGED_IN':
|
||||
return { ...state, loggedIn: true };
|
||||
|
||||
case 'USER_LOGOUT':
|
||||
return { ...state, loggedIn: false };
|
||||
|
||||
case 'CHANGE_WEBCAM':
|
||||
{
|
||||
return { ...state, selectedWebcam: action.payload.deviceId };
|
||||
|
||||
@@ -142,6 +142,13 @@ export const userLogin = () =>
|
||||
};
|
||||
};
|
||||
|
||||
export const userLogout = () =>
|
||||
{
|
||||
return {
|
||||
type: 'USER_LOGOUT'
|
||||
};
|
||||
};
|
||||
|
||||
export const raiseHand = () =>
|
||||
{
|
||||
return {
|
||||
|
||||
@@ -181,6 +181,13 @@ export default ({ dispatch, getState }) => (next) =>
|
||||
break;
|
||||
}
|
||||
|
||||
case 'USER_LOGOUT':
|
||||
{
|
||||
client.logout();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'LOWER_HAND':
|
||||
{
|
||||
client.sendRaiseHandState(false);
|
||||
|
||||
@@ -443,4 +443,9 @@ export const setPeerPicture = (peerName, picture) =>
|
||||
({
|
||||
type : 'SET_PEER_PICTURE',
|
||||
payload : { peerName, picture }
|
||||
});
|
||||
|
||||
export const loggedIn = () =>
|
||||
({
|
||||
type: 'LOGGED_IN',
|
||||
});
|
||||
Reference in New Issue
Block a user