mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fix inverse relation creation, closes #1498
This commit is contained in:
		
							parent
							
								
									b093569ec5
								
							
						
					
					
						commit
						eaf93a70cd
					
				| @ -9,7 +9,7 @@ async function syncNow() { | ||||
|     } | ||||
|     else { | ||||
|         if (result.message.length > 200) { | ||||
|             result.message = result.message.substr(0, 200); | ||||
|             result.message = result.message.substr(0, 200) + "..."; | ||||
|         } | ||||
| 
 | ||||
|         toastService.showError("Sync failed: " + result.message); | ||||
|  | ||||
| @ -94,10 +94,10 @@ eventService.subscribe(eventService.CHILD_NOTE_CREATED, ({ parentNote, childNote | ||||
| function processInverseRelations(entityName, entity, handler) { | ||||
|     if (entityName === 'attributes' && entity.type === 'relation') { | ||||
|         const note = entity.getNote(); | ||||
|         const attributes = (note.getOwnedAttributes(entity.name)).filter(relation => relation.type === 'relation-definition'); | ||||
|         const relDefinitions = note.getLabels('relation:' + entity.name); | ||||
| 
 | ||||
|         for (const attribute of attributes) { | ||||
|             const definition = attribute.value; | ||||
|         for (const relDefinition of relDefinitions) { | ||||
|             const definition = relDefinition.getDefinition(); | ||||
| 
 | ||||
|             if (definition.inverseRelation && definition.inverseRelation.trim()) { | ||||
|                 const targetNote = entity.getTargetNote(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam