mirror of
https://github.com/thelounge/thelounge
synced 2024-11-29 23:40:28 +00:00
21 lines
504 B
JavaScript
21 lines
504 B
JavaScript
"use strict";
|
|
|
|
const socket = require("../socket");
|
|
const {vueApp} = require("../vue");
|
|
const store = require("../store").default;
|
|
|
|
socket.on("more", function(data) {
|
|
const channel = store.getters.findChannel(data.chan);
|
|
|
|
if (!channel) {
|
|
return;
|
|
}
|
|
|
|
channel.channel.moreHistoryAvailable =
|
|
data.totalMessages > channel.channel.messages.length + data.messages.length;
|
|
channel.channel.messages.unshift(...data.messages);
|
|
|
|
vueApp.$nextTick(() => {
|
|
channel.channel.historyLoading = false;
|
|
});
|
|
});
|