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.

AbstractSuspendedOverlay.ts 889B

12345678910111213141516171819202122232425262728
  1. import { Component } from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { IReduxState } from '../../../app/types';
  4. /**
  5. * The type of the React {@code Component} props of
  6. * {@link AbstractSuspendedOverlay}.
  7. */
  8. type Props = WithTranslation;
  9. /**
  10. * Implements a React {@link Component} for suspended overlay. Shown when a
  11. * suspend is detected.
  12. */
  13. export default class AbstractSuspendedOverlay extends Component<Props> {
  14. /**
  15. * Determines whether this overlay needs to be rendered (according to a
  16. * specific redux state). Called by {@link OverlayContainer}.
  17. *
  18. * @param {Object} state - The redux state.
  19. * @returns {boolean} - If this overlay needs to be rendered, {@code true};
  20. * {@code false}, otherwise.
  21. */
  22. static needsRender(state: IReduxState) {
  23. return state['features/power-monitor']?.suspendDetected;
  24. }
  25. }