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.js 1.2KB

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