question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It does not display the second page

See original GitHub issue

For some reason the infinity-loader does not display the content from the second page. It loads and displays the first page, requests the content from the endpoint, the model gets updated (I can see it by checking its length in the view, also the inspector shows me it successfully returned the new data) but the infinity-loader only displays the content from the first page, being stuck with the loading text defined in the view.

My API is a little different than usual. I have a random page number and can’t send the standard params to avoid wrong behavior on my API, that’s why I had to delete it from the params object.

const ExtendedInfinityModel = InfinityModel.extend({
  buildParams() {
    let params = this._super(...arguments);
    params["page[number]"] = this.get('nextPage');
    delete params.page;
    delete params.per_page;
    return params;
  },

  afterInfinityModel(chats) {
    this.set('canLoadMore', chats.get('length') > 0);
    this.set('nextPage', chats.get('meta.paginate.next.number'));
  },
});

model(params) {
    return RSVP.hash({
      chats: this.infinity.model(
        "chat", 
        { "page[limit]": 6 }, 
        ExtendedInfinityModel
      )
    });
  }
{{infinity-loader
  scrollable="#inbox-list-items"
  infinityModel=model.chats
  loadingText='Carregando...'
  loadedText='Todos os itens carregados.'
}}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
rodrigoyoshidacommented, Aug 2, 2018

I am happy to see I was able to help you improve the addon! By the way, it is really awesome! We use it a lot here and we are really happy that it has a great support. Good job!

0reactions
snewcomercommented, Aug 2, 2018

Closing for now. Let me know if there is anything else you see! 🎉 Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The most common multi-monitor problems and how to fix them
Multiple monitors can improve productivity and multitasking, but the setup doesn't always work as expected. Here are fixes for many common ...
Read more >
Word doesn't show next page - Microsoft Community
On the Page Layout tab, in the Page Setup group, click the button for Columns. In the dropdown menu, choose More Columns... In...
Read more >
How to fix second monitor not detected on Windows 10
In this guide, we'll show you the steps to detect a second monitor on your laptop or desktop PC when Windows 10 does...
Read more >
[Solved] Cannot Insert Second Page - Microsoft Office Forums
I just opened a blank screen and proceeded to format from there. The paragraph display is on, but I still can't get the...
Read more >
What To Do When Your Second Monitor Is Not Detected
Fix Second Monitor Is Not Detected in Windows 10 ... You can do this by going to the display manufacturer's website and check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found