thelounge/client/js/socket-events/more.js

20 lines
408 B
JavaScript
Raw Normal View History

2017-05-18 22:08:54 +02:00
"use strict";
const socket = require("../socket");
2018-07-12 18:25:41 +02:00
const {vueApp, findChannel} = require("../vue");
2017-05-18 22:08:54 +02:00
socket.on("more", function(data) {
const channel = findChannel(data.chan);
if (!channel) {
return;
2017-05-18 22:08:54 +02:00
}
channel.channel.moreHistoryAvailable = data.moreHistoryAvailable;
channel.channel.messages.unshift(...data.messages);
2018-07-12 18:25:41 +02:00
vueApp.$nextTick(() => {
channel.channel.historyLoading = false;
});
2017-05-18 22:08:54 +02:00
});