FIX: the empty state message was appearing on the user bookmarks page when a user have bookmarks (PR #14127)

Steps to reproduce:

  1. Go to activity/bookmarks
  2. Search for something that isn’t in your bookmarks, so you get no results
  3. Navigate away and then click “Bookmarked” on the sidebar or open the user menu and click the View All Bookmarks button on the bottom of the bookmarks tab, and you get this:

This PR fixes the problem. We have a controller with a query parameter q that contains a search query. And we also have a property searchTerm that is bound to the search box on the page and mirrors the value in q. We were using a value from searchTerm when querying the server, but ember controllers are singletons so the searchTerm value persisted between page visits and leaded to this bug.

To make things work properly, we should be using the value from q everywhere except two places when we copy a value from q to searchTerm and vice versa.

GitHub