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.

HangupButton.js 729B

12345678910111213141516171819202122232425262728293031323334
  1. // @flow
  2. import { AbstractHangupButton } from '../base/toolbox';
  3. import type { AbstractButtonProps as Props } from '../base/toolbox';
  4. const { api } = window.alwaysOnTop;
  5. /**
  6. * Stateless hangup button for the Always-on-Top windows.
  7. */
  8. export default class HangupButton extends AbstractHangupButton<Props, *> {
  9. /**
  10. * Helper function to perform the actual hangup action.
  11. *
  12. * @override
  13. * @private
  14. * @returns {void}
  15. */
  16. _doHangup() {
  17. api.executeCommand('hangup');
  18. window.close();
  19. }
  20. /**
  21. * Indicates whether this button is disabled or not.
  22. *
  23. * @override
  24. * @private
  25. * @returns {boolean}
  26. */
  27. _isDisabled() {
  28. return false;
  29. }
  30. }