23 lines
488 B
JavaScript
23 lines
488 B
JavaScript
"use strict";
|
|
|
|
import Vue from "vue";
|
|
|
|
const socket = require("../socket");
|
|
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);
|
|
|
|
Vue.nextTick(() => {
|
|
channel.channel.historyLoading = false;
|
|
});
|
|
});
|