Attempt to fix when message delete and no more messages present

This commit is contained in:
Jeremy Zhang 2018-03-31 04:48:48 +00:00
parent 57669576c9
commit 0433040ede

View File

@ -1733,11 +1733,11 @@
return;
}
$("#discordmessage_"+msg.id).parent().remove();
var lastelem = $("#chatcontent").find("[id^=discordmessage_]").last();
if (!lastelem.length) {
last_message_id = null;
var lastelem = $("#chatcontent").find("[id^=discordmessage_]");
if (lastelem.length) {
last_message_id = lastelem.last().attr('id').substring(15);
} else {
last_message_id = lastelem.attr('id').substring(15);
last_message_id = null;
}
});