2020-04-15 15:13:43 +02:00
|
|
|
// @flow
|
|
|
|
|
|
2021-04-21 16:48:05 +03:00
|
|
|
/**
|
|
|
|
|
* Selector to return lobby state.
|
|
|
|
|
*
|
|
|
|
|
* @param {any} state - State object.
|
|
|
|
|
* @returns {any}
|
|
|
|
|
*/
|
|
|
|
|
export function getLobbyState(state: any) {
|
|
|
|
|
return state['features/lobby'];
|
|
|
|
|
}
|
2021-07-06 22:07:52 +03:00
|
|
|
|
|
|
|
|
|
2021-08-20 11:53:11 +03:00
|
|
|
/**
|
|
|
|
|
* Selector to return lobby visibility.
|
|
|
|
|
*
|
|
|
|
|
* @param {any} state - State object.
|
|
|
|
|
* @returns {any}
|
|
|
|
|
*/
|
|
|
|
|
export function getIsLobbyVisible(state: any) {
|
|
|
|
|
return state['features/lobby'].lobbyVisible;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-06 22:07:52 +03:00
|
|
|
/**
|
2021-07-13 16:17:20 +03:00
|
|
|
* Selector to return array with knocking participant ids.
|
2021-07-06 22:07:52 +03:00
|
|
|
*
|
|
|
|
|
* @param {any} state - State object.
|
|
|
|
|
* @returns {Array}
|
|
|
|
|
*/
|
|
|
|
|
export function getKnockingParticipantsById(state: any) {
|
|
|
|
|
const { knockingParticipants } = state['features/lobby'];
|
|
|
|
|
|
|
|
|
|
return knockingParticipants.map(participant => participant.id);
|
|
|
|
|
}
|