Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6984 Rev 6985
Línea 42... Línea 42...
42
        if (!success) {
42
        if (!success) {
43
          return
43
          return
44
        }
44
        }
Línea 45... Línea 45...
45
 
45
 
46
        const resConversations = data
-
 
47
 
46
        const resConversations = data
48
        const newConversations = resConversations.reduce(
47
        const newConversations = resConversations.reduce(
49
          (acum, conversation) => {
48
          (acum, conversation) => {
50
            const messageIndex = conversations.findIndex(
49
            const messageIndex = conversations.findIndex(
51
              ({ uuid }) => uuid === conversation.id
50
              ({ uuid }) => uuid === conversation.uuid
Línea 52... Línea 51...
52
            )
51
            )
53
 
52
 
54
            if (messageIndex === -1) {
53
            if (messageIndex === -1) {
Línea 102... Línea 101...
102
      clearTimeout(messagesInterval)
101
      clearTimeout(messagesInterval)
103
    }
102
    }
104
  }, [loading])
103
  }, [loading])
Línea 105... Línea 104...
105
 
104
 
106
  useEffect(() => {
105
  useEffect(() => {
107
    if (uuid) {
106
    if (uuid && !currentConversation) {
108
      const conversation = conversations.find((c) => c.uuid === uuid)
107
      const conversation = conversations.find((c) => c.uuid === uuid)
109
      conversation && setCurrentConversation(conversation)
108
      conversation && setCurrentConversation(conversation)
110
    }
109
    }