You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 518B

1234567891011121314151617
  1. // @flow
  2. import { toState } from '../base/redux';
  3. /**
  4. * Tells whether or not the notifications are enabled and if there are any
  5. * notifications to be displayed based on the current Redux state.
  6. *
  7. * @param {Object|Function} stateful - The redux store state.
  8. * @returns {boolean}
  9. */
  10. export function areThereNotifications(stateful: Object | Function) {
  11. const state = toState(stateful);
  12. const { enabled, notifications } = state['features/notifications'];
  13. return enabled && notifications.length > 0;
  14. }