MOBILE-3833 glossary: Fix check empty entries list

main
Dani Palou 2022-04-13 09:14:09 +02:00
parent c6bdde182c
commit 56d0cf251d
2 changed files with 10 additions and 1 deletions

View File

@ -65,7 +65,7 @@
</ng-container>
</ion-list>
<core-empty-box *ngIf="(!entries || entries.empty) && (!isSearch || hasSearched)" icon="fas-list"
<core-empty-box *ngIf="(!entries || !entries.hasEntries) && (!isSearch || hasSearched)" icon="fas-list"
[message]="'addon.mod_glossary.noentriesfound' | translate">
</core-empty-box>

View File

@ -472,4 +472,13 @@ class AddonModGlossaryEntriesManager extends CoreListItemsManager<AddonModGlossa
}
}
/**
* Check whether there is any entry in the items.
*
* @return Whether there is an entry.
*/
get hasEntries(): boolean {
return this.getSource().onlineEntries.length > 0 || this.getSource().offlineEntries.length > 0;
}
}