mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	fixes in "other notes with relation..."
This commit is contained in:
		
							parent
							
								
									e78b495bd3
								
							
						
					
					
						commit
						f49f510459
					
				@ -232,7 +232,9 @@ function getRelatedNotes(req) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const results = [];
 | 
					    const results = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (const record of matchingNameAndValue.concat(matchingName)) {
 | 
					    const allResults = matchingNameAndValue.concat(matchingName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (const record of allResults) {
 | 
				
			||||||
        if (results.length >= 20) {
 | 
					        if (results.length >= 20) {
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -245,7 +247,7 @@ function getRelatedNotes(req) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
        count: matchingName.length,
 | 
					        count: allResults.length,
 | 
				
			||||||
        results
 | 
					        results
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -266,6 +268,10 @@ function formatAttrForSearch(attr, searchWithValue) {
 | 
				
			|||||||
    searchStr += attr.name;
 | 
					    searchStr += attr.name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (searchWithValue && attr.value) {
 | 
					    if (searchWithValue && attr.value) {
 | 
				
			||||||
 | 
					        if (attr.type === 'relation') {
 | 
				
			||||||
 | 
					            searchStr += ".noteId";
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        searchStr += '=';
 | 
					        searchStr += '=';
 | 
				
			||||||
        searchStr += formatValue(attr.value);
 | 
					        searchStr += formatValue(attr.value);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user