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

17 lines
367 B
JavaScript
Raw Normal View History

2017-05-18 22:08:54 +02:00
"use strict";
const socket = require("../socket");
2018-07-12 12:59:03 +02:00
const {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-08 15:42:54 +02:00
channel.channel.historyLoading = false;
2017-05-18 22:08:54 +02:00
});