Fix having no "load more projects" available when using the search

When the `_onGetProjectsFirstPageFinished` is reached, the pagination manager already contains the correct pagination metadata and links, so calling `clear()` there resets them giving the impression that there is no next page.

This commit fixed that by calling the `clear()` function should when the search filter is applied, instead.

CURA-8009
This commit is contained in:
Konstantinos Karmas 2021-07-14 15:32:57 +02:00
parent 888f62a9ea
commit fd322c0512

View file

@ -211,7 +211,6 @@ class DigitalFactoryController(QObject):
:param df_projects: A list of all the Digital Factory Library projects linked to the user's account
"""
self.clear()
self.setHasMoreProjectsToLoad(self._api.hasMoreProjectsToLoad())
self._project_model.setProjects(df_projects)
self.setRetrievingProjectsStatus(RetrievalStatus.Success)
@ -338,6 +337,7 @@ class DigitalFactoryController(QObject):
Actually apply the current filter to search for projects with the user-defined search string.
:return:
"""
self.clear()
self.projectFilterChanged.emit()
self._api.getProjectsFirstPage(search_filter = self._project_filter, on_finished = self._onGetProjectsFirstPageFinished, failed = self._onGetProjectsFailed)