Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

functions.js 617B

1234567891011121314151617181920212223
  1. // @flow
  2. /**
  3. * Should poll results be shown.
  4. *
  5. * @param {Object} state - Global state.
  6. * @param {string} id - Id of the poll.
  7. * @returns {boolean} Should poll results be shown.
  8. */
  9. export const shouldShowResults = (state: Object, id: string) => Boolean(state['features/polls']?.polls[id].showResults);
  10. /**
  11. * Selector for calculating the number of unread poll messages.
  12. *
  13. * @param {Object} state - The redux state.
  14. * @returns {number} The number of unread messages.
  15. */
  16. export function getUnreadPollCount(state: Object) {
  17. const { nbUnreadPolls } = state['features/polls'];
  18. return nbUnreadPolls;
  19. }