Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7253 Rev 7254
Línea 38... Línea 38...
38
 
38
 
39
  const { messages, loadMore, loading, reset } =
39
  const { messages, loadMore, loading, reset } =
40
    useMessages(url_get_all_messages)
40
    useMessages(url_get_all_messages)
41
  const [isShowConferenceModal, setisShowConferenceModal] = useState(false)
41
  const [isShowConferenceModal, setisShowConferenceModal] = useState(false)
42
  const [isShowConfirmModal, setisShowConfirmModal] = useState(false)
42
  const [isShowConfirmModal, setisShowConfirmModal] = useState(false)
43
  const dispatch = useDispatch()
43
  const [options, setOptions] = useState([])
44
  const scrollRef = useRef(null)
-
 
45
  const options = useRef([])
44
  const scrollRef = useRef(null)
-
 
45
  const actionUrl = useRef('')
Línea 46... Línea 46...
46
  const actionUrl = useRef('')
46
  const dispatch = useDispatch()
47
 
47
 
48
  const toggleConfirmModal = () => {
48
  const toggleConfirmModal = () => {
Línea 66... Línea 66...
66
      changeTab(CHAT_TABS.DEFAULT)
66
      changeTab(CHAT_TABS.DEFAULT)
67
    })
67
    })
68
  }
68
  }
Línea 69... Línea 69...
69
 
69
 
70
  useEffect(() => {
70
  useEffect(() => {
71
    if (entity.url_leave) {
71
    if (url_leave) {
-
 
72
      setOptions([
-
 
73
        ...options,
72
      options.current.push({
74
        {
73
        url: url_leave,
75
          url: url_leave,
74
        label: 'Dejar Grupo',
76
          label: 'Dejar Grupo',
75
        action: () => {
77
          action: () => {
76
          toggleConfirmModal()
78
            toggleConfirmModal()
-
 
79
            actionUrl.current = url_leave
77
          actionUrl.current = entity.url_leave
80
          },
78
        },
81
        },
79
      })
82
      ])
80
    }
83
    }
81
    if (entity.url_delete) {
84
    if (url_delete) {
-
 
85
      setOptions([
-
 
86
        ...options,
82
      options.current.push({
87
        {
83
        url: url_delete,
88
          url: url_delete,
84
        label: 'Eliminar Grupo',
89
          label: 'Eliminar Grupo',
85
        action: () => {
90
          action: () => {
86
          toggleConfirmModal()
91
            toggleConfirmModal()
-
 
92
            actionUrl.current = url_delete
87
          actionUrl.current = entity.url_delete
93
          },
88
        },
94
        },
89
      })
95
      ])
90
    }
96
    }
91
    if (entity.url_get_contact_group_list) {
97
    if (url_get_contact_group_list) {
-
 
98
      setOptions([
-
 
99
        ...options,
92
      options.current.push({
100
        {
93
        url: url_get_contact_group_list,
101
          url: url_get_contact_group_list,
94
        label: 'Integrantes',
102
          label: 'Integrantes',
-
 
103
          action: () => changeTab(CHAT_TABS.GROUP_MEMBERS),
95
        action: () => changeTab(CHAT_TABS.GROUP_MEMBERS),
104
        },
96
      })
105
      ])
97
    }
106
    }
98
    if (entity.url_add_user_to_group) {
107
    if (url_add_user_to_group) {
-
 
108
      setOptions([
-
 
109
        ...options,
99
      options.current.push({
110
        {
100
        url: url_add_user_to_group,
111
          url: url_add_user_to_group,
101
        label: 'Agregar Contactos',
112
          label: 'Agregar Contactos',
-
 
113
          action: () => changeTab(CHAT_TABS.ADD_GROUP_MEMBER),
102
        action: () => changeTab(CHAT_TABS.ADD_GROUP_MEMBER),
114
        },
103
      })
115
      ])
104
    }
116
    }
105
    if (entity.url_zoom) {
117
    if (url_zoom) {
-
 
118
      setOptions([
-
 
119
        ...options,
106
      options.current.push({
120
        {
107
        url: url_zoom,
121
          url: url_zoom,
108
        label: 'Crear Conferencia',
122
          label: 'Crear Conferencia',
-
 
123
          action: toggleConferenceModal,
109
        action: toggleConferenceModal,
124
        },
110
      })
125
      ])
111
    }
126
    }
Línea 112... Línea 127...
112
  }, [entity])
127
  }, [entity])
113
 
128