mirror of https://github.com/jitsi/jitsi-meet
parent
2cd43ba2e4
commit
65c56669c4
@ -1,16 +1,22 @@ |
||||
// @flow
|
||||
|
||||
import { TOGGLE_CHAT } from './actionTypes'; |
||||
import { OPEN_CHAT } from './actionTypes'; |
||||
|
||||
export * from './actions.any'; |
||||
|
||||
/** |
||||
* Toggles display of the chat panel. |
||||
* Displays the chat panel. |
||||
* |
||||
* @returns {Function} |
||||
* @param {Object} participant - The recipient for the private chat. |
||||
* |
||||
* @returns {{ |
||||
* participant: Participant, |
||||
* type: OPEN_CHAT |
||||
* }} |
||||
*/ |
||||
export function toggleChat() { |
||||
return function(dispatch: (Object) => Object) { |
||||
dispatch({ type: TOGGLE_CHAT }); |
||||
export function openChat(participant: Object) { |
||||
return { |
||||
participant, |
||||
type: OPEN_CHAT |
||||
}; |
||||
} |
||||
|
@ -1,20 +1,44 @@ |
||||
// @flow
|
||||
|
||||
import type { Dispatch } from 'redux'; |
||||
|
||||
import VideoLayout from '../../../modules/UI/videolayout/VideoLayout'; |
||||
|
||||
import { TOGGLE_CHAT } from './actionTypes'; |
||||
import { OPEN_CHAT } from './actionTypes'; |
||||
import { closeChat } from './actions.any'; |
||||
|
||||
export * from './actions.any'; |
||||
|
||||
/** |
||||
* Toggles display of the chat side panel while also taking window |
||||
* resize into account. |
||||
* Displays the chat panel. |
||||
* |
||||
* @returns {Function} |
||||
* @param {Object} participant - The recipient for the private chat. |
||||
* @returns {{ |
||||
* participant: Participant, |
||||
* type: OPEN_CHAT |
||||
* }} |
||||
*/ |
||||
export function toggleChat() { |
||||
export function openChat(participant: Object) { |
||||
return function(dispatch: (Object) => Object) { |
||||
dispatch({ type: TOGGLE_CHAT }); |
||||
dispatch({ participant, |
||||
type: OPEN_CHAT }); |
||||
VideoLayout.onResize(); |
||||
}; |
||||
} |
||||
|
||||
/** |
||||
* Toggles display of the chat panel. |
||||
* |
||||
* @returns {Function} |
||||
*/ |
||||
export function toggleChat() { |
||||
return (dispatch: Dispatch<any>, getState: Function) => { |
||||
const isOpen = getState()['features/chat'].isOpen; |
||||
|
||||
if (isOpen) { |
||||
dispatch(closeChat()); |
||||
} else { |
||||
dispatch(openChat()); |
||||
} |
||||
}; |
||||
} |
||||
|
Loading…
Reference in new issue