Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3107 Rev 3119
Línea 105... Línea 105...
105
  const [availableContactsToAdd, setAvailableContactsToAdd] = useState([]);
105
  const [availableContactsToAdd, setAvailableContactsToAdd] = useState([]);
106
  const [groupContactsList, setGroupContactsList] = useState([]);
106
  const [groupContactsList, setGroupContactsList] = useState([]);
107
  const [confirmModalShow, setConfirmModalShow] = useState(false);
107
  const [confirmModalShow, setConfirmModalShow] = useState(false);
108
  const [showEmojiTab, setShowEmojiTab] = useState(false);
108
  const [showEmojiTab, setShowEmojiTab] = useState(false);
109
  const [shareFileModalShow, setShareFileModalShow] = useState(false);
109
  const [shareFileModalShow, setShareFileModalShow] = useState(false);
-
 
110
  const [loading, setLoading] = useState(false);
Línea 110... Línea 111...
110
 
111
 
111
  // refs
112
  // refs
112
  const conversationListEl = useRef(null);
113
  const conversationListEl = useRef(null);
113
  const loader = useRef(null);
114
  const loader = useRef(null);
Línea 154... Línea 155...
154
  //   });
155
  //   });
155
  //   onRead(index);
156
  //   onRead(index);
156
  // };
157
  // };
Línea 157... Línea 158...
157
 
158
 
-
 
159
  const handleGetMessages = async () => {
158
  const handleGetMessages = async () => {
160
    setLoading(true)
159
    const response = await axios.get(url_get_all_messages);
161
    const response = await axios.get(url_get_all_messages);
160
    const resData = response.data;
162
    const resData = response.data;
161
    if (!resData.success) {
163
    if (!resData.success) {
162
      return ("ha ocurrido un error", resData);
164
      return ("ha ocurrido un error", resData);
Línea 169... Línea 171...
169
      return acum;
171
      return acum;
170
    }, []);
172
    }, []);
Línea 171... Línea 173...
171
 
173
 
172
    if (newMessages.length > 0) {
174
    if (newMessages.length > 0) {
-
 
175
      setMessages([...messages, ...newMessages]);
173
      setMessages([...messages, ...newMessages]);
176
      setLoading(false)
174
      setPages(resData.data.pages);
177
      setPages(resData.data.pages);
175
      scrollToBottom();
178
      scrollToBottom();
176
    } else {
179
    } else {
-
 
180
      setMessages([...updatedMessages]);
177
      setMessages([...updatedMessages]);
181
      setLoading(false)
178
    }
182
    }
Línea 179... Línea 183...
179
  };
183
  };
180
 
184
 
Línea 336... Línea 340...
336
    if (window.location.pathname === '/group/my-groups') {
340
    if (window.location.pathname === '/group/my-groups') {
337
      const items = document.getElementsByClassName('sc-jSgupP')
341
      const items = document.getElementsByClassName('sc-jSgupP')
338
      if (items && items.length > 0)
342
      if (items && items.length > 0)
339
        items[0].style.display = 'none';
343
        items[0].style.display = 'none';
340
    }
344
    }
341
    if (!minimized) {
345
    if (!minimized && !loading) {
342
      clearInterval(getMessageInterval);
-
 
343
      getMessageInterval = setInterval(() => {
346
      setTimeout(() => {
344
        handleGetMessages();
347
        handleGetMessages();
345
      }, 1000);
348
      }, 1000);
346
    } else {
-
 
347
      clearInterval(getMessageInterval);
-
 
348
    }
349
    }
349
    return () => {
-
 
350
      clearInterval(getMessageInterval);
350
  }, [minimized, loading]);
351
    };
-
 
352
  });
-
 
Línea 353... Línea 351...
353
 
351
 
354
  const handleConfirmModalShow = () => {
352
  const handleConfirmModalShow = () => {
355
    setConfirmModalShow(!confirmModalShow);
353
    setConfirmModalShow(!confirmModalShow);