Ioninifinite method is called twice and renders duplicate data


#1

Hi i am using ion-infinite-scroll to render list of post from database however the ioninifinite method gets called twice and renders duplicate data for the first time however it doesn’t happens if scroll event is slow can anyone suggest me why this happens?

do infinite method
doInfinite(infiniteScroll) {
setTimeout(() => {
this.getPosts();
console.log(‘scroll fn called’);
infiniteScroll.complete();
}, 1000);
}


#2

any news? same problem here


#3

I fixed the issue by using promises and called the infinitescroll.complete() method after making api calls