Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15943 Rev 15975
Línea 66... Línea 66...
66
          },
66
          },
67
          []
67
          []
68
        );
68
        );
Línea 69... Línea 69...
69
 
69
 
70
        if (updatedMessages.length > 0) {
70
        if (updatedMessages.length > 0) {
71
          setMessages([...messages, ...updatedMessages]);
71
          setMessages((prevMessages) => [...prevMessages, ...updatedMessages]);
72
          setTotalPages(data.pages);
72
          setTotalPages(data.pages);
73
          scrollToBottom();
73
          scrollToBottom();
74
        }
74
        }
75
      })
75
      })
Línea 103... Línea 103...
103
    divToScrollEl.scrollIntoView({ behavior: "smooth" });
103
    divToScrollEl.scrollIntoView({ behavior: "smooth" });
104
  };
104
  };
Línea 105... Línea 105...
105
 
105
 
106
  const onClickEmoji = (event) => {
106
  const onClickEmoji = (event) => {
107
    const shortname = event.currentTarget.dataset.shortname;
-
 
-
 
107
    const shortname = event.currentTarget.dataset.shortname;
-
 
108
    const currentText = inputTextEl.current.value;
-
 
109
    let cursorPosition = inputTextEl.current.selectionStart;
-
 
110
    const textBehind = currentText.substring(0, cursorPosition);
108
 
111
    const textForward = currentText.substring(cursorPosition);
109
    inputTextEl.current.value += shortname;
112
    inputTextEl.current.value = `${textBehind}${shortname}${textForward}`;
-
 
113
    inputTextEl.current.focus();
-
 
114
    inputTextEl.current.setSelectionRange(
-
 
115
      cursorPosition + shortname.length,
-
 
116
      cursorPosition + shortname.length
110
    inputTextEl.current.focus();
117
    );
Línea 111... Línea 118...
111
  };
118
  };
112
 
119
 
113
  const handleUploadFile = ({ target }) => {
-
 
114
    const file = target.files[0];
120
  const handleUploadFile = ({ target }) => {
115
 
-
 
116
    if (!file) {
-
 
117
      return;
-
 
118
    }
121
    const file = target.files[0];
119
 
122
    if (!file) return;
Línea 120... Línea 123...
120
    setSelectedFile(file);
123
    setSelectedFile(file);
121
  };
124
  };