您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.native.ts 1.2KB

1234567891011121314151617181920212223242526272829303132
  1. import { IReduxState } from '../../app/types';
  2. export * from './functions.any';
  3. /**
  4. * Returns whether the conference is in connecting state.
  5. *
  6. * @param {Object} state - The redux state.
  7. * @returns {boolean} Whether conference is connecting.
  8. */
  9. export const isConnecting = (state: IReduxState) => {
  10. const { connecting, connection } = state['features/base/connection'];
  11. const {
  12. conference,
  13. joining,
  14. membersOnly,
  15. leaving
  16. } = state['features/base/conference'];
  17. // XXX There is a window of time between the successful establishment of the
  18. // XMPP connection and the subsequent commencement of joining the MUC during
  19. // which the app does not appear to be doing anything according to the redux
  20. // state. In order to not toggle the _connecting props during the window of
  21. // time in question, define _connecting as follows:
  22. // - the XMPP connection is connecting, or
  23. // - the XMPP connection is connected and the conference is joining, or
  24. // - the XMPP connection is connected and we have no conference yet, nor we
  25. // are leaving one.
  26. return Boolean(
  27. connecting || (connection && (!membersOnly && (joining || (!conference && !leaving))))
  28. );
  29. };