Improve readability of more.js
This commit is contained in:
parent
0fb6dae8a6
commit
bd4e821614
@ -6,17 +6,17 @@ import socket from "../socket";
|
|||||||
import store from "../store";
|
import store from "../store";
|
||||||
|
|
||||||
socket.on("more", function (data) {
|
socket.on("more", function (data) {
|
||||||
const channel = store.getters.findChannel(data.chan);
|
const channel = store.getters.findChannel(data.chan).channel;
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel.channel.moreHistoryAvailable =
|
channel.moreHistoryAvailable =
|
||||||
data.totalMessages > channel.channel.messages.length + data.messages.length;
|
data.totalMessages > channel.messages.length + data.messages.length;
|
||||||
channel.channel.messages.unshift(...data.messages);
|
channel.messages.unshift(...data.messages);
|
||||||
|
|
||||||
Vue.nextTick(() => {
|
Vue.nextTick(() => {
|
||||||
channel.channel.historyLoading = false;
|
channel.historyLoading = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user