mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
display mirror relations correctly on relation map
This commit is contained in:
@@ -68,10 +68,20 @@ class Attribute extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note|null>}
|
||||
*/
|
||||
async getNote() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
if (!this.__note) {
|
||||
this.__note = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
}
|
||||
|
||||
return this.__note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note|null>}
|
||||
*/
|
||||
async getTargetNote() {
|
||||
if (this.type !== 'relation') {
|
||||
throw new Error(`Attribute ${this.attributeId} is not relation`);
|
||||
@@ -81,9 +91,16 @@ class Attribute extends Entity {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
|
||||
if (!this.__targetNote) {
|
||||
this.__targetNote = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
|
||||
}
|
||||
|
||||
return this.__targetNote;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
isDefinition() {
|
||||
return this.type === 'label-definition' || this.type === 'relation-definition';
|
||||
}
|
||||
@@ -134,7 +151,7 @@ module.exports = Attribute;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
Reference in New Issue
Block a user