refactoring for archived notes handling in note cache

This commit is contained in:
zadam
2020-09-07 00:05:01 +02:00
parent eb4d86f41d
commit 69e36d2677
8 changed files with 22 additions and 29 deletions

View File

@@ -177,7 +177,7 @@ function getNotePath(noteId) {
function evaluateSimilarity(sourceNote, candidateNote, results) {
let coeff = stringSimilarity.compareTwoStrings(sourceNote.flatText, candidateNote.flatText);
if (coeff > 0.4) {
if (coeff > 0.5) {
const notePath = getSomePath(candidateNote);
// this takes care of note hoisting
@@ -214,7 +214,7 @@ function findSimilarNotes(noteId) {
}
for (const note of Object.values(noteCache.notes)) {
if (note.isProtected && !note.isDecrypted) {
if (note.noteId === origNote.noteId) {
continue;
}