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
1 changed files with 5 additions and 5 deletions

View File

@ -6,17 +6,17 @@ import socket from "../socket";
import store from "../store";
socket.on("more", function (data) {
const channel = store.getters.findChannel(data.chan);
const channel = store.getters.findChannel(data.chan).channel;
if (!channel) {
return;
}
channel.channel.moreHistoryAvailable =
data.totalMessages > channel.channel.messages.length + data.messages.length;
channel.channel.messages.unshift(...data.messages);
channel.moreHistoryAvailable =
data.totalMessages > channel.messages.length + data.messages.length;
channel.messages.unshift(...data.messages);
Vue.nextTick(() => {
channel.channel.historyLoading = false;
channel.historyLoading = false;
});
});