2022-09-30 14:50:45 +00:00
|
|
|
import {
|
|
|
|
RESET_WHITEBOARD,
|
|
|
|
SETUP_WHITEBOARD,
|
|
|
|
SET_WHITEBOARD_OPEN
|
|
|
|
} from './actionTypes';
|
2022-10-20 09:11:27 +00:00
|
|
|
import { IWhiteboardAction } from './reducer';
|
2022-09-30 14:50:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Configures the whiteboard collaboration details.
|
|
|
|
*
|
|
|
|
* @param {Object} payload - The whiteboard settings.
|
|
|
|
* @returns {{
|
|
|
|
* type: SETUP_WHITEBOARD,
|
|
|
|
* collabDetails: { roomId: string, roomKey: string }
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export const setupWhiteboard = ({ collabDetails }: {
|
|
|
|
collabDetails: { roomId: string; roomKey: string; };
|
2022-10-20 09:11:27 +00:00
|
|
|
}): IWhiteboardAction => {
|
2022-09-30 14:50:45 +00:00
|
|
|
return {
|
|
|
|
type: SETUP_WHITEBOARD,
|
|
|
|
collabDetails
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cleans up the whiteboard collaboration settings.
|
|
|
|
* To be used only on native for cleanup in between conferences.
|
|
|
|
*
|
|
|
|
* @returns {{
|
|
|
|
* type: RESET_WHITEBOARD
|
|
|
|
* }}
|
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
export const resetWhiteboard = (): IWhiteboardAction => {
|
2022-09-30 14:50:45 +00:00
|
|
|
return { type: RESET_WHITEBOARD };
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the whiteboard visibility status.
|
|
|
|
*
|
|
|
|
* @param {boolean} isOpen - The whiteboard visibility flag.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_WHITEBOARD_OPEN,
|
|
|
|
* isOpen
|
|
|
|
* }}
|
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
export const setWhiteboardOpen = (isOpen: boolean): IWhiteboardAction => {
|
2022-09-30 14:50:45 +00:00
|
|
|
return {
|
|
|
|
type: SET_WHITEBOARD_OPEN,
|
|
|
|
isOpen
|
|
|
|
};
|
|
|
|
};
|