Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5064 Rev 5065
Línea 80... Línea 80...
80
    if (!data.success) console.log('Error in entity close')
80
    if (!data.success) console.log('Error in entity close')
81
    setActiveChats(activeChats.filter(prevActiveChats => prevActiveChats.id !== entity.id))
81
    setActiveChats(activeChats.filter(prevActiveChats => prevActiveChats.id !== entity.id))
82
  }
82
  }
Línea 83... Línea 83...
83
 
83
 
84
  const handleOpenConversation = async (entity, minimized = false) => {
-
 
85
 
-
 
86
    console.log(activeChats.some(el => el.id === entity.id))
-
 
87
    console.log(activeChats.length)
-
 
88
    console.log(activeChats)
-
 
89
    console.log(entity)
-
 
90
 
84
  const handleOpenConversation = async (entity, minimized = false) => {
91
    if (activeChats.some(el => el.id === entity.id)) {
85
    if (activeChats.some(el => el.id === entity.id)) {
92
      return null
86
      return null
Línea 93... Línea 87...
93
    }
87
    }
94
 
88
 
95
    if (activeChats.length >= 3) {
89
    if (activeChats.length >= 3) {
96
      await handleCloseConversation(activeChats[0])
90
      await handleCloseConversation(activeChats[0])
97
      setActiveChats(prevActiveChats => [...prevActiveChats, { ...entity, minimized: minimized }])
91
      setActiveChats(prevActiveChats => [...prevActiveChats, { ...entity, minimized: minimized }])
Línea 98... Línea -...
98
      return
-
 
99
    }
-
 
100
 
92
      return
101
    console.log('Paso')
93
    }
Línea 102... Línea 94...
102
 
94
 
103
    setActiveChats(prevActiveChats => [...prevActiveChats, { ...entity, minimized: minimized }])
95
    setActiveChats(prevActiveChats => [...prevActiveChats, { ...entity, minimized: minimized }])