2020-04-15 15:13:43 +02:00
|
|
|
// @flow
|
|
|
|
|
|
2021-04-21 16:48:05 +03:00
|
|
|
/**
|
2021-08-18 14:29:41 +03: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 16:48:05 +03:00
|
|
|
}
|
2021-07-06 22:07:52 +03:00
|
|
|
|
2021-08-18 14:29:41 +03: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 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) {
|
2021-08-18 14:29:41 +03:00
|
|
|
return getKnockingParticipants(state).map(participant => participant.id);
|
2021-07-06 22:07:52 +03:00
|
|
|
}
|