mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 14:25:51 +01:00
small attribute optimizations
This commit is contained in:
@@ -126,7 +126,9 @@ class SNote extends AbstractShacaEntity {
|
||||
* @returns {SAttribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
getAttributes(type, name) {
|
||||
this.__getAttributes([]);
|
||||
if (!this.__attributeCache) {
|
||||
this.__getAttributes([]);
|
||||
}
|
||||
|
||||
if (type && name) {
|
||||
return this.__attributeCache.filter(attr => attr.type === type && attr.name === name && !isCredentials(attr));
|
||||
@@ -428,11 +430,6 @@ class SNote extends AbstractShacaEntity {
|
||||
return this.hasAttribute('label', 'archived');
|
||||
}
|
||||
|
||||
/** @returns {boolean} */
|
||||
hasInheritableOwnedArchivedLabel() {
|
||||
return !!this.ownedAttributes.find(attr => attr.type === 'label' && attr.name === 'archived' && attr.isInheritable);
|
||||
}
|
||||
|
||||
/** @returns {boolean} */
|
||||
isInherited() {
|
||||
return !!this.targetRelations.find(rel => rel.name === 'template' || rel.name === 'inherit');
|
||||
|
||||
Reference in New Issue
Block a user