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.native.ts 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { IStateful } from '../base/app/types';
  2. import { isLocalParticipantModerator } from '../base/participants/functions';
  3. import { toState } from '../base/redux/functions';
  4. import { getParticipantsPaneConfig } from '../participants-pane/functions';
  5. export * from './functions.any';
  6. /**
  7. * Used on web.
  8. *
  9. * @param {(Function|Object)} _stateful -The (whole) redux state, or redux's
  10. * {@code getState} function to be used to retrieve the state.
  11. * @param {boolean} _isDisplayedOnWelcomePage - Indicates whether the shortcuts dialog is displayed on the
  12. * welcome page or not.
  13. * @returns {Object} - The properties for the "Shortcuts" tab from settings
  14. * dialog.
  15. */
  16. export function getShortcutsTabProps(_stateful: any, _isDisplayedOnWelcomePage?: boolean) {
  17. // needed to fix lint error.
  18. return {
  19. keyboardShortcutsEnabled: false
  20. };
  21. }
  22. /**
  23. * Returns true if moderator tab in settings should be visible/accessible.
  24. *
  25. * @param {(Function|Object)} stateful - The (whole) redux state, or redux's
  26. * {@code getState} function to be used to retrieve the state.
  27. * @returns {boolean} True to indicate that moderator tab should be visible, false otherwise.
  28. */
  29. export function shouldShowModeratorSettings(stateful: IStateful) {
  30. const state = toState(stateful);
  31. const { hideModeratorSettingsTab } = getParticipantsPaneConfig(state);
  32. const hasModeratorRights = isLocalParticipantModerator(state);
  33. return hasModeratorRights && !hideModeratorSettingsTab;
  34. }