2020-04-15 13:13:43 +00:00
|
|
|
// @flow
|
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
2021-08-18 11:29:41 +00:00
|
|
|
* Selector to return lobby enable state.
|
|
|
|
*
|
|
|
|
* @param {any} state - State object.
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
export function getLobbyEnabled(state: any) {
|
|
|
|
return state['features/lobby'].lobbyEnabled;
|
2021-04-21 13:48:05 +00:00
|
|
|
}
|
2021-07-06 19:07:52 +00:00
|
|
|
|
2021-08-18 11:29:41 +00:00
|
|
|
/**
|
|
|
|
* Selector to return a list of knocking participants.
|
|
|
|
*
|
|
|
|
* @param {any} state - State object.
|
|
|
|
* @returns {Array<Object>}
|
|
|
|
*/
|
|
|
|
export function getKnockingParticipants(state: any) {
|
|
|
|
return state['features/lobby'].knockingParticipants;
|
|
|
|
}
|
2021-07-06 19:07:52 +00:00
|
|
|
|
2021-08-20 08:53:11 +00: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 19:07:52 +00:00
|
|
|
/**
|
2021-07-13 13:17:20 +00:00
|
|
|
* Selector to return array with knocking participant ids.
|
2021-07-06 19:07:52 +00:00
|
|
|
*
|
|
|
|
* @param {any} state - State object.
|
|
|
|
* @returns {Array}
|
|
|
|
*/
|
|
|
|
export function getKnockingParticipantsById(state: any) {
|
2021-08-18 11:29:41 +00:00
|
|
|
return getKnockingParticipants(state).map(participant => participant.id);
|
2021-07-06 19:07:52 +00:00
|
|
|
}
|