[Sprint/Votes](bug): Hard coded a stop for duplicate blog entries being added based on length
Is the data held in response.entities here the full list of entries to be displayed regardless of which tab it is on? For example, if it only grabs 64 entries at a time, and then another call is made later for the next entries [65-128], this will not work.
- Last updated by Martin Santangelo
30 30 response.entities.shift(); 31 31 } 32 32 response.entities = BlogModel.createMany(response.entities); 33 if(response.entities.length === this.list.entities.slice(0).length) return; - Maintainer
I think that here the blog service needs to use the request abort. The flat list fires the
OnEndReached
event many times usually.For example: https://gitlab.com/minds/mobile-native/blob/master/src/groups/GroupsService.js#L21
- Developer
That seems to have stopped any second call being made, but allows you to scroll down through white space.
Edited by Ben Hayward - Maintainer
you have to send 'blogs:list' as the third parameter of the api.get() call:
const data = await api.get(endpoint, { limit: 12, offset: offset }, 'blogs:list');
This will 'tag' the fetch, and in the next call to
abort('blogs:list')
it will cancel the previous one (if it is not finished)
- Developer
Updated to match but now only the first batch load, and the FlatList is huge (or the visible container atleast). Is there anything you can think of that I could add into a conditional around the abort? Not quite sure of what I have a hold of in scope in the service.
- Developer
No longer occuring.
closed