FIX: Update user results page when no users found (#18363)

The page was not updated if the server did not return any results. This
caused the page to be either empty or display the previous result set.
This commit is contained in:
Bianca Nenciu
2022-09-26 16:37:56 +03:00
committed by GitHub
parent f64e7233e5
commit b81afa0756
3 changed files with 22 additions and 5 deletions
@@ -59,10 +59,10 @@ export default Controller.extend(CanCheckEmails, {
page,
})
.then((result) => {
if (result && result.length > 0) {
this._results[page] = result;
this.set("model", this._results.flat());
} else {
this._results[page] = result;
this.set("model", this._results.flat());
if (result.length === 0) {
this._canLoadMore = false;
}
})