Add letter icon option for collections

This commit is contained in:
Tom Moor
2023-09-15 08:54:22 -04:00
parent b79f86d347
commit 6b4feb51e0
9 changed files with 107 additions and 25 deletions

View File

@@ -126,6 +126,16 @@ export default class Collection extends ParanoidModel {
return sortNavigationNodes(this.documents, this.sort);
}
/**
* The initial letter of the collection name.
*
* @returns string
*/
@computed
get initial() {
return this.name ? this.name[0] : "?";
}
fetchDocuments = async (options?: { force: boolean }) => {
if (this.isFetching) {
return;