Refactor stateActions for better overview.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export const addUserMessage = (text) =>
|
||||
({
|
||||
type : 'ADD_NEW_USER_MESSAGE',
|
||||
payload : { text }
|
||||
});
|
||||
|
||||
export const addResponseMessage = (message) =>
|
||||
({
|
||||
type : 'ADD_NEW_RESPONSE_MESSAGE',
|
||||
payload : { message }
|
||||
});
|
||||
|
||||
export const addChatHistory = (chatHistory) =>
|
||||
({
|
||||
type : 'ADD_CHAT_HISTORY',
|
||||
payload : { chatHistory }
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
export const addConsumer = (consumer, peerId) =>
|
||||
({
|
||||
type : 'ADD_CONSUMER',
|
||||
payload : { consumer, peerId }
|
||||
});
|
||||
|
||||
export const removeConsumer = (consumerId, peerId) =>
|
||||
({
|
||||
type : 'REMOVE_CONSUMER',
|
||||
payload : { consumerId, peerId }
|
||||
});
|
||||
|
||||
export const setConsumerPaused = (consumerId, originator) =>
|
||||
({
|
||||
type : 'SET_CONSUMER_PAUSED',
|
||||
payload : { consumerId, originator }
|
||||
});
|
||||
|
||||
export const setConsumerResumed = (consumerId, originator) =>
|
||||
({
|
||||
type : 'SET_CONSUMER_RESUMED',
|
||||
payload : { consumerId, originator }
|
||||
});
|
||||
|
||||
export const setConsumerCurrentLayers = (consumerId, spatialLayer, temporalLayer) =>
|
||||
({
|
||||
type : 'SET_CONSUMER_CURRENT_LAYERS',
|
||||
payload : { consumerId, spatialLayer, temporalLayer }
|
||||
});
|
||||
|
||||
export const setConsumerPreferredLayers = (consumerId, spatialLayer, temporalLayer) =>
|
||||
({
|
||||
type : 'SET_CONSUMER_PREFERRED_LAYERS',
|
||||
payload : { consumerId, spatialLayer, temporalLayer }
|
||||
});
|
||||
|
||||
export const setConsumerTrack = (consumerId, track) =>
|
||||
({
|
||||
type : 'SET_CONSUMER_TRACK',
|
||||
payload : { consumerId, track }
|
||||
});
|
||||
|
||||
export const setConsumerScore = (consumerId, score) =>
|
||||
({
|
||||
type : 'SET_CONSUMER_SCORE',
|
||||
payload : { consumerId, score }
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
export const addFile = (peerId, magnetUri) =>
|
||||
({
|
||||
type : 'ADD_FILE',
|
||||
payload : { peerId, magnetUri }
|
||||
});
|
||||
|
||||
export const addFileHistory = (fileHistory) =>
|
||||
({
|
||||
type : 'ADD_FILE_HISTORY',
|
||||
payload : { fileHistory }
|
||||
});
|
||||
|
||||
export const setFileActive = (magnetUri) =>
|
||||
({
|
||||
type : 'SET_FILE_ACTIVE',
|
||||
payload : { magnetUri }
|
||||
});
|
||||
|
||||
export const setFileInActive = (magnetUri) =>
|
||||
({
|
||||
type : 'SET_FILE_INACTIVE',
|
||||
payload : { magnetUri }
|
||||
});
|
||||
|
||||
export const setFileProgress = (magnetUri, progress) =>
|
||||
({
|
||||
type : 'SET_FILE_PROGRESS',
|
||||
payload : { magnetUri, progress }
|
||||
});
|
||||
|
||||
export const setFileDone = (magnetUri, sharedFiles) =>
|
||||
({
|
||||
type : 'SET_FILE_DONE',
|
||||
payload : { magnetUri, sharedFiles }
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
export const addLobbyPeer = (peerId) =>
|
||||
({
|
||||
type : 'ADD_LOBBY_PEER',
|
||||
payload : { peerId }
|
||||
});
|
||||
|
||||
export const removeLobbyPeer = (peerId) =>
|
||||
({
|
||||
type : 'REMOVE_LOBBY_PEER',
|
||||
payload : { peerId }
|
||||
});
|
||||
|
||||
export const setLobbyPeerDisplayName = (displayName, peerId) =>
|
||||
({
|
||||
type : 'SET_LOBBY_PEER_DISPLAY_NAME',
|
||||
payload : { displayName, peerId }
|
||||
});
|
||||
|
||||
export const setLobbyPeerPicture = (picture, peerId) =>
|
||||
({
|
||||
type : 'SET_LOBBY_PEER_PICTURE',
|
||||
payload : { picture, peerId }
|
||||
});
|
||||
|
||||
export const setLobbyPeerPromotionInProgress = (peerId, flag) =>
|
||||
({
|
||||
type : 'SET_LOBBY_PEER_PROMOTION_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
});
|
||||
@@ -0,0 +1,76 @@
|
||||
export const setMe = ({ peerId, device, loginEnabled }) =>
|
||||
({
|
||||
type : 'SET_ME',
|
||||
payload : { peerId, device, loginEnabled }
|
||||
});
|
||||
|
||||
export const loggedIn = (flag) =>
|
||||
({
|
||||
type : 'LOGGED_IN',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setPicture = (picture) =>
|
||||
({
|
||||
type : 'SET_PICTURE',
|
||||
payload : { picture }
|
||||
});
|
||||
|
||||
export const setMediaCapabilities = ({
|
||||
canSendMic,
|
||||
canSendWebcam,
|
||||
canShareScreen,
|
||||
canShareFiles
|
||||
}) =>
|
||||
({
|
||||
type : 'SET_MEDIA_CAPABILITIES',
|
||||
payload : { canSendMic, canSendWebcam, canShareScreen, canShareFiles }
|
||||
});
|
||||
|
||||
export const setAudioDevices = (devices) =>
|
||||
({
|
||||
type : 'SET_AUDIO_DEVICES',
|
||||
payload : { devices }
|
||||
});
|
||||
|
||||
export const setWebcamDevices = (devices) =>
|
||||
({
|
||||
type : 'SET_WEBCAM_DEVICES',
|
||||
payload : { devices }
|
||||
});
|
||||
|
||||
export const setMyRaiseHandState = (flag) =>
|
||||
({
|
||||
type : 'SET_MY_RAISE_HAND_STATE',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setAudioInProgress = (flag) =>
|
||||
({
|
||||
type : 'SET_AUDIO_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setWebcamInProgress = (flag) =>
|
||||
({
|
||||
type : 'SET_WEBCAM_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setScreenShareInProgress = (flag) =>
|
||||
({
|
||||
type : 'SET_SCREEN_SHARE_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setMyRaiseHandStateInProgress = (flag) =>
|
||||
({
|
||||
type : 'SET_MY_RAISE_HAND_STATE_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setDisplayNameInProgress = (flag) =>
|
||||
({
|
||||
type : 'SET_DISPLAY_NAME_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
export const addNotification = (notification) =>
|
||||
({
|
||||
type : 'ADD_NOTIFICATION',
|
||||
payload : { notification }
|
||||
});
|
||||
|
||||
export const removeNotification = (notificationId) =>
|
||||
({
|
||||
type : 'REMOVE_NOTIFICATION',
|
||||
payload : { notificationId }
|
||||
});
|
||||
|
||||
export const removeAllNotifications = () =>
|
||||
({
|
||||
type : 'REMOVE_ALL_NOTIFICATIONS'
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
export const addPeer = (peer) =>
|
||||
({
|
||||
type : 'ADD_PEER',
|
||||
payload : { peer }
|
||||
});
|
||||
|
||||
export const removePeer = (peerId) =>
|
||||
({
|
||||
type : 'REMOVE_PEER',
|
||||
payload : { peerId }
|
||||
});
|
||||
|
||||
export const setPeerDisplayName = (displayName, peerId) =>
|
||||
({
|
||||
type : 'SET_PEER_DISPLAY_NAME',
|
||||
payload : { displayName, peerId }
|
||||
});
|
||||
|
||||
export const setPeerVideoInProgress = (peerId, flag) =>
|
||||
({
|
||||
type : 'SET_PEER_VIDEO_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
});
|
||||
|
||||
export const setPeerAudioInProgress = (peerId, flag) =>
|
||||
({
|
||||
type : 'SET_PEER_AUDIO_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
});
|
||||
|
||||
export const setPeerScreenInProgress = (peerId, flag) =>
|
||||
({
|
||||
type : 'SET_PEER_SCREEN_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
});
|
||||
|
||||
export const setPeerRaiseHandState = (peerId, raiseHandState) =>
|
||||
({
|
||||
type : 'SET_PEER_RAISE_HAND_STATE',
|
||||
payload : { peerId, raiseHandState }
|
||||
});
|
||||
|
||||
export const setPeerPicture = (peerId, picture) =>
|
||||
({
|
||||
type : 'SET_PEER_PICTURE',
|
||||
payload : { peerId, picture }
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
export const setPeerVolume = (peerId, volume) =>
|
||||
({
|
||||
type : 'SET_PEER_VOLUME',
|
||||
payload : { peerId, volume }
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
export const addProducer = (producer) =>
|
||||
({
|
||||
type : 'ADD_PRODUCER',
|
||||
payload : { producer }
|
||||
});
|
||||
|
||||
export const removeProducer = (producerId) =>
|
||||
({
|
||||
type : 'REMOVE_PRODUCER',
|
||||
payload : { producerId }
|
||||
});
|
||||
|
||||
export const setProducerPaused = (producerId, originator) =>
|
||||
({
|
||||
type : 'SET_PRODUCER_PAUSED',
|
||||
payload : { producerId, originator }
|
||||
});
|
||||
|
||||
export const setProducerResumed = (producerId, originator) =>
|
||||
({
|
||||
type : 'SET_PRODUCER_RESUMED',
|
||||
payload : { producerId, originator }
|
||||
});
|
||||
|
||||
export const setProducerTrack = (producerId, track) =>
|
||||
({
|
||||
type : 'SET_PRODUCER_TRACK',
|
||||
payload : { producerId, track }
|
||||
});
|
||||
|
||||
export const setProducerScore = (producerId, score) =>
|
||||
({
|
||||
type : 'SET_PRODUCER_SCORE',
|
||||
payload : { producerId, score }
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import randomString from 'random-string';
|
||||
import * as stateActions from './stateActions';
|
||||
import * as notificationActions from './notificationActions';
|
||||
|
||||
// This returns a redux-thunk action (a function).
|
||||
export const notify = ({ type = 'info', text, timeout }) =>
|
||||
@@ -30,11 +30,11 @@ export const notify = ({ type = 'info', text, timeout }) =>
|
||||
|
||||
return (dispatch) =>
|
||||
{
|
||||
dispatch(stateActions.addNotification(notification));
|
||||
dispatch(notificationActions.addNotification(notification));
|
||||
|
||||
setTimeout(() =>
|
||||
{
|
||||
dispatch(stateActions.removeNotification(notification.id));
|
||||
dispatch(notificationActions.removeNotification(notification.id));
|
||||
}, timeout);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
export const setRoomUrl = (url) =>
|
||||
({
|
||||
type : 'SET_ROOM_URL',
|
||||
payload : { url }
|
||||
});
|
||||
|
||||
export const setRoomName = (name) =>
|
||||
({
|
||||
type : 'SET_ROOM_NAME',
|
||||
payload : { name }
|
||||
|
||||
});
|
||||
|
||||
export const setRoomState = (state) =>
|
||||
({
|
||||
type : 'SET_ROOM_STATE',
|
||||
payload : { state }
|
||||
|
||||
});
|
||||
|
||||
export const setRoomActiveSpeaker = (peerId) =>
|
||||
({
|
||||
type : 'SET_ROOM_ACTIVE_SPEAKER',
|
||||
payload : { peerId }
|
||||
});
|
||||
|
||||
export const setRoomLocked = () =>
|
||||
({
|
||||
type : 'SET_ROOM_LOCKED'
|
||||
});
|
||||
|
||||
export const setRoomUnLocked = () =>
|
||||
({
|
||||
type : 'SET_ROOM_UNLOCKED'
|
||||
});
|
||||
|
||||
export const setInLobby = (inLobby) =>
|
||||
({
|
||||
type : 'SET_IN_LOBBY',
|
||||
payload : { inLobby }
|
||||
});
|
||||
|
||||
export const setSignInRequired = (signInRequired) =>
|
||||
({
|
||||
type : 'SET_SIGN_IN_REQUIRED',
|
||||
payload : { signInRequired }
|
||||
});
|
||||
|
||||
export const setAccessCode = (accessCode) =>
|
||||
({
|
||||
type : 'SET_ACCESS_CODE',
|
||||
payload : { accessCode }
|
||||
});
|
||||
|
||||
export const setJoinByAccessCode = (joinByAccessCode) =>
|
||||
({
|
||||
type : 'SET_JOIN_BY_ACCESS_CODE',
|
||||
payload : { joinByAccessCode }
|
||||
});
|
||||
|
||||
export const setSettingsOpen = ({ settingsOpen }) =>
|
||||
({
|
||||
type : 'SET_SETTINGS_OPEN',
|
||||
payload : { settingsOpen }
|
||||
});
|
||||
|
||||
export const setLockDialogOpen = ({ lockDialogOpen }) =>
|
||||
({
|
||||
type : 'SET_LOCK_DIALOG_OPEN',
|
||||
payload : { lockDialogOpen }
|
||||
});
|
||||
|
||||
export const setFileSharingSupported = (supported) =>
|
||||
({
|
||||
type : 'FILE_SHARING_SUPPORTED',
|
||||
payload : { supported }
|
||||
});
|
||||
|
||||
export const toggleConsumerWindow = (consumerId) =>
|
||||
({
|
||||
type : 'TOGGLE_WINDOW_CONSUMER',
|
||||
payload : { consumerId }
|
||||
});
|
||||
|
||||
export const setToolbarsVisible = (toolbarsVisible) =>
|
||||
({
|
||||
type : 'SET_TOOLBARS_VISIBLE',
|
||||
payload : { toolbarsVisible }
|
||||
});
|
||||
|
||||
export const setDisplayMode = (mode) =>
|
||||
({
|
||||
type : 'SET_DISPLAY_MODE',
|
||||
payload : { mode }
|
||||
});
|
||||
|
||||
export const setSelectedPeer = (selectedPeerId) =>
|
||||
({
|
||||
type : 'SET_SELECTED_PEER',
|
||||
payload : { selectedPeerId }
|
||||
});
|
||||
|
||||
export const setSpotlights = (spotlights) =>
|
||||
({
|
||||
type : 'SET_SPOTLIGHTS',
|
||||
payload : { spotlights }
|
||||
});
|
||||
|
||||
export const toggleJoined = () =>
|
||||
({
|
||||
type : 'TOGGLE_JOINED'
|
||||
});
|
||||
|
||||
export const toggleConsumerFullscreen = (consumerId) =>
|
||||
({
|
||||
type : 'TOGGLE_FULLSCREEN_CONSUMER',
|
||||
payload : { consumerId }
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
export const setSelectedAudioDevice = (deviceId) =>
|
||||
({
|
||||
type : 'CHANGE_AUDIO_DEVICE',
|
||||
payload : { deviceId }
|
||||
});
|
||||
|
||||
export const setSelectedWebcamDevice = (deviceId) =>
|
||||
({
|
||||
type : 'CHANGE_WEBCAM',
|
||||
payload : { deviceId }
|
||||
});
|
||||
|
||||
export const setVideoResolution = (resolution) =>
|
||||
({
|
||||
type : 'SET_VIDEO_RESOLUTION',
|
||||
payload : { resolution }
|
||||
});
|
||||
|
||||
export const setDisplayName = (displayName) =>
|
||||
({
|
||||
type : 'SET_DISPLAY_NAME',
|
||||
payload : { displayName }
|
||||
});
|
||||
|
||||
export const toggleAdvancedMode = () =>
|
||||
({
|
||||
type : 'TOGGLE_ADVANCED_MODE'
|
||||
});
|
||||
@@ -1,673 +0,0 @@
|
||||
export const setRoomUrl = (url) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ROOM_URL',
|
||||
payload : { url }
|
||||
};
|
||||
};
|
||||
|
||||
export const setRoomName = (name) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ROOM_NAME',
|
||||
payload : { name }
|
||||
};
|
||||
};
|
||||
|
||||
export const setRoomState = (state) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ROOM_STATE',
|
||||
payload : { state }
|
||||
};
|
||||
};
|
||||
|
||||
export const setRoomActiveSpeaker = (peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ROOM_ACTIVE_SPEAKER',
|
||||
payload : { peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setRoomLocked = () =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ROOM_LOCKED'
|
||||
};
|
||||
};
|
||||
|
||||
export const setRoomUnLocked = () =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ROOM_UNLOCKED'
|
||||
};
|
||||
};
|
||||
|
||||
export const setInLobby = (inLobby) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_IN_LOBBY',
|
||||
payload : { inLobby }
|
||||
};
|
||||
};
|
||||
|
||||
export const setSignInRequired = (signInRequired) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_SIGN_IN_REQUIRED',
|
||||
payload : { signInRequired }
|
||||
};
|
||||
};
|
||||
|
||||
export const setAccessCode = (accessCode) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ACCESS_CODE',
|
||||
payload : { accessCode }
|
||||
};
|
||||
};
|
||||
|
||||
export const setJoinByAccessCode = (joinByAccessCode) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_JOIN_BY_ACCESS_CODE',
|
||||
payload : { joinByAccessCode }
|
||||
};
|
||||
};
|
||||
|
||||
export const setSettingsOpen = ({ settingsOpen }) =>
|
||||
({
|
||||
type : 'SET_SETTINGS_OPEN',
|
||||
payload : { settingsOpen }
|
||||
});
|
||||
|
||||
export const setLockDialogOpen = ({ lockDialogOpen }) =>
|
||||
({
|
||||
type : 'SET_LOCK_DIALOG_OPEN',
|
||||
payload : { lockDialogOpen }
|
||||
});
|
||||
|
||||
export const setMe = ({ peerId, device, loginEnabled }) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_ME',
|
||||
payload : { peerId, device, loginEnabled }
|
||||
};
|
||||
};
|
||||
|
||||
export const setMediaCapabilities = ({
|
||||
canSendMic,
|
||||
canSendWebcam,
|
||||
canShareScreen,
|
||||
canShareFiles
|
||||
}) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_MEDIA_CAPABILITIES',
|
||||
payload : { canSendMic, canSendWebcam, canShareScreen, canShareFiles }
|
||||
};
|
||||
};
|
||||
|
||||
export const setAudioDevices = (devices) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_AUDIO_DEVICES',
|
||||
payload : { devices }
|
||||
};
|
||||
};
|
||||
|
||||
export const setWebcamDevices = (devices) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_WEBCAM_DEVICES',
|
||||
payload : { devices }
|
||||
};
|
||||
};
|
||||
|
||||
export const setSelectedAudioDevice = (deviceId) =>
|
||||
{
|
||||
return {
|
||||
type : 'CHANGE_AUDIO_DEVICE',
|
||||
payload : { deviceId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setSelectedWebcamDevice = (deviceId) =>
|
||||
{
|
||||
return {
|
||||
type : 'CHANGE_WEBCAM',
|
||||
payload : { deviceId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setVideoResolution = (resolution) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_VIDEO_RESOLUTION',
|
||||
payload : { resolution }
|
||||
};
|
||||
};
|
||||
|
||||
export const setFileSharingSupported = (supported) =>
|
||||
{
|
||||
return {
|
||||
type : 'FILE_SHARING_SUPPORTED',
|
||||
payload : { supported }
|
||||
};
|
||||
};
|
||||
|
||||
export const setDisplayName = (displayName) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_DISPLAY_NAME',
|
||||
payload : { displayName }
|
||||
};
|
||||
};
|
||||
|
||||
export const setDisplayNameInProgress = (flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_DISPLAY_NAME_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleAdvancedMode = () =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_ADVANCED_MODE'
|
||||
};
|
||||
};
|
||||
|
||||
export const setDisplayMode = (mode) =>
|
||||
({
|
||||
type : 'SET_DISPLAY_MODE',
|
||||
payload : { mode }
|
||||
});
|
||||
|
||||
export const setPeerVideoInProgress = (peerId, flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PEER_VIDEO_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPeerAudioInProgress = (peerId, flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PEER_AUDIO_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPeerScreenInProgress = (peerId, flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PEER_SCREEN_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const setMyRaiseHandState = (flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_MY_RAISE_HAND_STATE',
|
||||
payload : { flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleSettings = () =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_SETTINGS'
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleLockDialog = () =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_LOCK_DIALOG'
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleToolArea = () =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_TOOL_AREA'
|
||||
};
|
||||
};
|
||||
|
||||
export const openToolArea = () =>
|
||||
{
|
||||
return {
|
||||
type : 'OPEN_TOOL_AREA'
|
||||
};
|
||||
};
|
||||
|
||||
export const closeToolArea = () =>
|
||||
{
|
||||
return {
|
||||
type : 'CLOSE_TOOL_AREA'
|
||||
};
|
||||
};
|
||||
|
||||
export const setToolTab = (toolTab) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_TOOL_TAB',
|
||||
payload : { toolTab }
|
||||
};
|
||||
};
|
||||
|
||||
export const setMyRaiseHandStateInProgress = (flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_MY_RAISE_HAND_STATE_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPeerRaiseHandState = (peerId, raiseHandState) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PEER_RAISE_HAND_STATE',
|
||||
payload : { peerId, raiseHandState }
|
||||
};
|
||||
};
|
||||
|
||||
export const addProducer = (producer) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_PRODUCER',
|
||||
payload : { producer }
|
||||
};
|
||||
};
|
||||
|
||||
export const removeProducer = (producerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'REMOVE_PRODUCER',
|
||||
payload : { producerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setProducerPaused = (producerId, originator) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PRODUCER_PAUSED',
|
||||
payload : { producerId, originator }
|
||||
};
|
||||
};
|
||||
|
||||
export const setProducerResumed = (producerId, originator) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PRODUCER_RESUMED',
|
||||
payload : { producerId, originator }
|
||||
};
|
||||
};
|
||||
|
||||
export const setProducerTrack = (producerId, track) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PRODUCER_TRACK',
|
||||
payload : { producerId, track }
|
||||
};
|
||||
};
|
||||
|
||||
export const setProducerScore = (producerId, score) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PRODUCER_SCORE',
|
||||
payload : { producerId, score }
|
||||
};
|
||||
};
|
||||
|
||||
export const setAudioInProgress = (flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_AUDIO_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const setWebcamInProgress = (flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_WEBCAM_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const setScreenShareInProgress = (flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_SCREEN_SHARE_IN_PROGRESS',
|
||||
payload : { flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const addPeer = (peer) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_PEER',
|
||||
payload : { peer }
|
||||
};
|
||||
};
|
||||
|
||||
export const removePeer = (peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'REMOVE_PEER',
|
||||
payload : { peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPeerDisplayName = (displayName, peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PEER_DISPLAY_NAME',
|
||||
payload : { displayName, peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const addConsumer = (consumer, peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_CONSUMER',
|
||||
payload : { consumer, peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const removeConsumer = (consumerId, peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'REMOVE_CONSUMER',
|
||||
payload : { consumerId, peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setConsumerPaused = (consumerId, originator) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_PAUSED',
|
||||
payload : { consumerId, originator }
|
||||
};
|
||||
};
|
||||
|
||||
export const setConsumerResumed = (consumerId, originator) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_RESUMED',
|
||||
payload : { consumerId, originator }
|
||||
};
|
||||
};
|
||||
|
||||
export const setConsumerCurrentLayers = (consumerId, spatialLayer, temporalLayer) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_CURRENT_LAYERS',
|
||||
payload : { consumerId, spatialLayer, temporalLayer }
|
||||
};
|
||||
};
|
||||
|
||||
export const setConsumerPreferredLayers = (consumerId, spatialLayer, temporalLayer) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_PREFERRED_LAYERS',
|
||||
payload : { consumerId, spatialLayer, temporalLayer }
|
||||
};
|
||||
};
|
||||
|
||||
export const setConsumerTrack = (consumerId, track) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_TRACK',
|
||||
payload : { consumerId, track }
|
||||
};
|
||||
};
|
||||
|
||||
export const setConsumerScore = (consumerId, score) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_SCORE',
|
||||
payload : { consumerId, score }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPeerVolume = (peerId, volume) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_PEER_VOLUME',
|
||||
payload : { peerId, volume }
|
||||
};
|
||||
};
|
||||
|
||||
export const addLobbyPeer = (peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_LOBBY_PEER',
|
||||
payload : { peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const removeLobbyPeer = (peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'REMOVE_LOBBY_PEER',
|
||||
payload : { peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setLobbyPeerDisplayName = (displayName, peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_LOBBY_PEER_DISPLAY_NAME',
|
||||
payload : { displayName, peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setLobbyPeerPicture = (picture, peerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_LOBBY_PEER_PICTURE',
|
||||
payload : { picture, peerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setLobbyPeerPromotionInProgress = (peerId, flag) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_LOBBY_PEER_PROMOTION_IN_PROGRESS',
|
||||
payload : { peerId, flag }
|
||||
};
|
||||
};
|
||||
|
||||
export const addNotification = (notification) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_NOTIFICATION',
|
||||
payload : { notification }
|
||||
};
|
||||
};
|
||||
|
||||
export const removeNotification = (notificationId) =>
|
||||
{
|
||||
return {
|
||||
type : 'REMOVE_NOTIFICATION',
|
||||
payload : { notificationId }
|
||||
};
|
||||
};
|
||||
|
||||
export const removeAllNotifications = () =>
|
||||
{
|
||||
return {
|
||||
type : 'REMOVE_ALL_NOTIFICATIONS'
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleChat = () =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_CHAT'
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleConsumerFullscreen = (consumerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_FULLSCREEN_CONSUMER',
|
||||
payload : { consumerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleConsumerWindow = (consumerId) =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_WINDOW_CONSUMER',
|
||||
payload : { consumerId }
|
||||
};
|
||||
};
|
||||
|
||||
export const setToolbarsVisible = (toolbarsVisible) => ({
|
||||
type : 'SET_TOOLBARS_VISIBLE',
|
||||
payload : { toolbarsVisible }
|
||||
});
|
||||
|
||||
export const increaseBadge = () =>
|
||||
{
|
||||
return {
|
||||
type : 'INCREASE_BADGE'
|
||||
};
|
||||
};
|
||||
|
||||
export const toggleInputDisabled = () =>
|
||||
{
|
||||
return {
|
||||
type : 'TOGGLE_INPUT_DISABLED'
|
||||
};
|
||||
};
|
||||
|
||||
export const addUserMessage = (text) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_NEW_USER_MESSAGE',
|
||||
payload : { text }
|
||||
};
|
||||
};
|
||||
|
||||
export const addUserFile = (file) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_NEW_USER_FILE',
|
||||
payload : { file }
|
||||
};
|
||||
};
|
||||
|
||||
export const addResponseMessage = (message) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_NEW_RESPONSE_MESSAGE',
|
||||
payload : { message }
|
||||
};
|
||||
};
|
||||
|
||||
export const addChatHistory = (chatHistory) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_CHAT_HISTORY',
|
||||
payload : { chatHistory }
|
||||
};
|
||||
};
|
||||
|
||||
export const dropMessages = () =>
|
||||
{
|
||||
return {
|
||||
type : 'DROP_MESSAGES'
|
||||
};
|
||||
};
|
||||
|
||||
export const addFile = (peerId, magnetUri) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_FILE',
|
||||
payload : { peerId, magnetUri }
|
||||
};
|
||||
};
|
||||
|
||||
export const addFileHistory = (fileHistory) =>
|
||||
{
|
||||
return {
|
||||
type : 'ADD_FILE_HISTORY',
|
||||
payload : { fileHistory }
|
||||
};
|
||||
};
|
||||
|
||||
export const setFileActive = (magnetUri) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_FILE_ACTIVE',
|
||||
payload : { magnetUri }
|
||||
};
|
||||
};
|
||||
|
||||
export const setFileInActive = (magnetUri) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_FILE_INACTIVE',
|
||||
payload : { magnetUri }
|
||||
};
|
||||
};
|
||||
|
||||
export const setFileProgress = (magnetUri, progress) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_FILE_PROGRESS',
|
||||
payload : { magnetUri, progress }
|
||||
};
|
||||
};
|
||||
|
||||
export const setFileDone = (magnetUri, sharedFiles) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_FILE_DONE',
|
||||
payload : { magnetUri, sharedFiles }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPicture = (picture) =>
|
||||
({
|
||||
type : 'SET_PICTURE',
|
||||
payload : { picture }
|
||||
});
|
||||
|
||||
export const setPeerPicture = (peerId, picture) =>
|
||||
({
|
||||
type : 'SET_PEER_PICTURE',
|
||||
payload : { peerId, picture }
|
||||
});
|
||||
|
||||
export const loggedIn = (flag) =>
|
||||
({
|
||||
type : 'LOGGED_IN',
|
||||
payload : { flag }
|
||||
});
|
||||
|
||||
export const toggleJoined = () =>
|
||||
({
|
||||
type : 'TOGGLE_JOINED'
|
||||
});
|
||||
|
||||
export const setSelectedPeer = (selectedPeerId) =>
|
||||
({
|
||||
type : 'SET_SELECTED_PEER',
|
||||
payload : { selectedPeerId }
|
||||
});
|
||||
|
||||
export const setSpotlights = (spotlights) =>
|
||||
({
|
||||
type : 'SET_SPOTLIGHTS',
|
||||
payload : { spotlights }
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
export const toggleToolArea = () =>
|
||||
({
|
||||
type : 'TOGGLE_TOOL_AREA'
|
||||
});
|
||||
|
||||
export const openToolArea = () =>
|
||||
({
|
||||
type : 'OPEN_TOOL_AREA'
|
||||
});
|
||||
|
||||
export const closeToolArea = () =>
|
||||
({
|
||||
type : 'CLOSE_TOOL_AREA'
|
||||
});
|
||||
|
||||
export const setToolTab = (toolTab) =>
|
||||
({
|
||||
type : 'SET_TOOL_TAB',
|
||||
payload : { toolTab }
|
||||
});
|
||||
Reference in New Issue
Block a user