Show avatar when logged in and support logging out

This commit is contained in:
Torjus
2018-07-24 11:14:52 +02:00
parent c414fd5301
commit aca2ec90f0
7 changed files with 57 additions and 14 deletions
+8 -1
View File
@@ -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 };
+7
View File
@@ -142,6 +142,13 @@ export const userLogin = () =>
};
};
export const userLogout = () =>
{
return {
type: 'USER_LOGOUT'
};
};
export const raiseHand = () =>
{
return {
+7
View File
@@ -181,6 +181,13 @@ export default ({ dispatch, getState }) => (next) =>
break;
}
case 'USER_LOGOUT':
{
client.logout();
break;
}
case 'LOWER_HAND':
{
client.sendRaiseHandState(false);
+5
View File
@@ -443,4 +443,9 @@ export const setPeerPicture = (peerName, picture) =>
({
type : 'SET_PEER_PICTURE',
payload : { peerName, picture }
});
export const loggedIn = () =>
({
type: 'LOGGED_IN',
});