After adding an empty state banner tot the user bookmarks page, we have found the bug. Steps to reproduce:
- Go to the user bookmarks page
- Search for something that doesn’t exist in bookmarks
- Click again Bookmarked on the sidebar or View All Bookmarks on the user menu again
You’ll see the empty state banner:
This is the problem with routing, and it’s hard to fix because of how this page is implemented. We’re not loading the model in the model hook in the route, so when transition happens ember call the model hook, but the loading isn’t happening.
This PR remove code that load bookmarks from the ember model. In general, this is an antipattern to be doing that. I moved initial loading to the model hook in the route, and loading of additional bookmarks that is triggered when a user scroll down the page - to the controller. This fixes the bug, and it also will save us from problems in the future when touching this code or migrating to new Ember versions.