Keep pendingMessage on reconnect

This commit is contained in:
Pavel Djundik 2018-07-17 11:03:35 +03:00 committed by Pavel Djundik
parent 987f48ae13
commit 1bfaef1985

View File

@ -28,9 +28,13 @@ socket.on("init", function(data) {
for (const channel of network.channels) { for (const channel of network.channels) {
const currentChannel = currentNetwork.channels.find((c) => c.id === channel.id); const currentChannel = currentNetwork.channels.find((c) => c.id === channel.id);
if (currentChannel && currentChannel.messages) { if (currentChannel) {
channel.scrolledToBottom = currentChannel.scrolledToBottom; channel.scrolledToBottom = currentChannel.scrolledToBottom;
channel.pendingMessage = currentChannel.pendingMessage;
if (currentChannel.messages) {
channel.messages = currentChannel.messages.concat(channel.messages); channel.messages = currentChannel.messages.concat(channel.messages);
}
if (currentChannel.moreHistoryAvailable) { if (currentChannel.moreHistoryAvailable) {
channel.moreHistoryAvailable = true; channel.moreHistoryAvailable = true;