Update Timeline.vue, batch api views

This commit is contained in:
Daniel Supernault 2021-05-24 00:37:52 -06:00
parent 444c6d5163
commit 3de44f3392
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 25 additions and 13 deletions

View file

@ -1076,13 +1076,14 @@
if (res.data.length && this.loading == false) {
let data = res.data;
let self = this;
let vids = [];
data.forEach((d, index) => {
if(self.ids.indexOf(d.id) == -1) {
self.feed.push(d);
self.ids.push(d.id);
axios.post('/api/status/view', {
'status_id': d.id,
'profile_id': d.account.id
vids.push({
sid: d.id,
pid: d.account.id
});
}
});
@ -1091,6 +1092,9 @@
this.page += 1;
$state.loaded();
this.loading = false;
axios.post('/api/status/view', {
'_v': vids,
});
} else {
$state.complete();
}