fix recent notes issues

This commit is contained in:
azivner
2018-06-06 22:38:36 -04:00
parent aee60c444f
commit 0e69f0c079
4 changed files with 39 additions and 53 deletions

View File

@@ -161,6 +161,15 @@ function getNoteTitle(noteId, parentNoteId) {
function getNoteTitleForPath(path) {
const titles = [];
if (path[0] === 'root') {
if (path.length === 1) {
return getNoteTitle('root');
}
else {
path = path.slice(1);
}
}
let parentNoteId = 'root';
for (const noteId of path) {
@@ -279,5 +288,6 @@ sqlInit.dbReady.then(() => utils.stopWatch("Autocomplete load", load));
module.exports = {
findNotes,
getNotePath
getNotePath,
getNoteTitleForPath
};