Fix: Should use newPin's length instead of the old length of pin

This commit is contained in:
winkidney
2019-03-18 17:21:25 +08:00
committed by Isaac Bythewood
parent e1d245f531
commit 765a188717

View File

@@ -228,7 +228,7 @@ Vue.component('pin-container', {
fetchPins(self.status.offset).then( fetchPins(self.status.offset).then(
function (res) { function (res) {
var newPins = self.pins.concat(res.data.results); var newPins = self.pins.concat(res.data.results);
self.counter.reset(self.pins.length); self.counter.reset(newPins.length);
self.pins = newPins; self.pins = newPins;
self.status.offset += res.data.results.length; self.status.offset += res.data.results.length;
if (res.data.next === null) { if (res.data.next === null) {