mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 14:00:21 +00:00
22 lines
470 B
JavaScript
22 lines
470 B
JavaScript
"use strict";
|
|
|
|
import Vue from "vue";
|
|
|
|
import socket from "../socket";
|
|
import store from "../store";
|
|
|
|
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);
|
|
|
|
Vue.nextTick(() => {
|
|
channel.channel.historyLoading = false;
|
|
});
|
|
});
|