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