Bug fixes: load old messages on scroll & show right avatar in pending messages

This commit is contained in:
Matéo Duparc 2021-08-02 21:18:06 +02:00
parent 0e1c17973b
commit c4417cf802
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E

View File

@ -237,7 +237,7 @@ document.getElementById("file_cancel").onclick = function() {
let msgLog = document.getElementById("msg_log"); let msgLog = document.getElementById("msg_log");
msgLog.onscroll = function() { msgLog.onscroll = function() {
let session = sessionsData.get(currentSessionId); let session = sessionsData.get(currentSessionId);
if (typeof sessions !== "undefined") { if (typeof session !== "undefined") {
if (session.isContact) { if (session.isContact) {
if (msgLog.scrollTop < 30) { if (msgLog.scrollTop < 30) {
socket.send("load_msgs "+currentSessionId); socket.send("load_msgs "+currentSessionId);
@ -1245,9 +1245,9 @@ function displayHistory(scrollToBottom = true) {
} }
let div; let div;
if (entry[0]) { //is file if (entry[0]) { //is file
div = generateFile(name, currentSessionId, true, entry[1]); div = generateFile(name, undefined, true, entry[1]);
} else { } else {
div = generateMessage(name, currentSessionId, entry[1]); div = generateMessage(name, undefined, entry[1]);
} }
let li = document.createElement("li"); let li = document.createElement("li");
li.appendChild(div); li.appendChild(div);