Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3081 | Rev 3141 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3081 Rev 3102
Línea 14... Línea 14...
14
    // xmpp_port
14
    // xmpp_port
15
  } = useSelector((state) => state.auth)
15
  } = useSelector((state) => state.auth)
16
  const isAuth = useSelector((state) => state.auth.isAuth)
16
  const isAuth = useSelector((state) => state.auth.isAuth)
Línea 17... Línea 17...
17
 
17
 
18
  useLayoutEffect(() => {
-
 
19
    if (!xmpp_hostname || !xmpp_username || !xmpp_password || !xmpp_domain)
-
 
20
      return
-
 
21
 
18
  useLayoutEffect(() => {
Línea -... Línea 19...
-
 
19
    const converse = window.converse
-
 
20
 
-
 
21
    if (!isAuth) {
-
 
22
      converse.connection?.disconnect()
-
 
23
    }
-
 
24
 
-
 
25
    if (!xmpp_hostname || !xmpp_username || !xmpp_password || !xmpp_domain) {
-
 
26
      return
22
    const converse = window.converse
27
    }
23
 
28
 
24
    converse.initialize({
29
    converse.initialize({
25
      bosh_service_url: `https://${xmpp_hostname}:${17443}/http-bind/`,
30
      bosh_service_url: `https://${xmpp_hostname}:${17443}/http-bind/`,
26
      authentication: 'login',
31
      authentication: 'login',
Línea 40... Línea 45...
40
    })
45
    })
Línea 41... Línea 46...
41
 
46
 
42
    return () => {
47
    return () => {
43
      converse.connection?.disconnect()
48
      converse.connection?.disconnect()
44
    }
49
    }
Línea 45... Línea 50...
45
  }, [xmpp_hostname, xmpp_password, xmpp_username])
50
  }, [xmpp_hostname, xmpp_password, xmpp_username, isAuth])
46
 
51