Improve readability of more.js

This commit is contained in:
Nachtalb 2021-05-01 01:36:44 +02:00
parent 0fb6dae8a6
commit bd4e821614
No known key found for this signature in database
GPG Key ID: E48DF13C07055D92

View File

@ -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;
}); });
}); });