mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
small refactorings
This commit is contained in:
@@ -252,14 +252,16 @@ class FNote {
|
||||
|
||||
const targetRelations = this.getTargetRelations().filter(relation => relation.name === 'imageLink');
|
||||
|
||||
if (targetRelations.length !== 1) {
|
||||
if (targetRelations.length > 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const parentNote = this.getParentNotes()[0]; // at this point note can have only one parent
|
||||
const referencingNote = targetRelations[0].getNote();
|
||||
const referencingNote = targetRelations[0]?.getNote();
|
||||
|
||||
if (parentNote !== referencingNote || parentNote.type !== 'text' || !parentNote.isContentAvailable()) {
|
||||
if (referencingNote && referencingNote !== parentNote) {
|
||||
return false;
|
||||
} else if (parentNote.type !== 'text' || !parentNote.isContentAvailable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user