選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

functions.js 831B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import { toState } from '../base/redux';
  3. declare var interfaceConfig: Object;
  4. /**
  5. * Tells whether or not the notifications are enabled and if there are any
  6. * notifications to be displayed based on the current Redux state.
  7. *
  8. * @param {Object|Function} stateful - The redux store state.
  9. * @returns {boolean}
  10. */
  11. export function areThereNotifications(stateful: Object | Function) {
  12. const state = toState(stateful);
  13. const { enabled, notifications } = state['features/notifications'];
  14. return enabled && notifications.length > 0;
  15. }
  16. /**
  17. * Tells whether join/leave notifications are enabled in interface_config.
  18. *
  19. * @returns {boolean}
  20. */
  21. export function joinLeaveNotificationsDisabled() {
  22. return Boolean(typeof interfaceConfig !== 'undefined' && interfaceConfig?.DISABLE_JOIN_LEAVE_NOTIFICATIONS);
  23. }