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";
|
||||
|
||||
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;
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user