WIP per-tab hoisting

This commit is contained in:
zadam
2020-11-23 22:52:48 +01:00
parent 167b6974fe
commit 52b8162d01
16 changed files with 64 additions and 74 deletions

View File

@@ -1,7 +1,7 @@
"use strict";
const noteCache = require('./note_cache');
const hoistedNoteService = require('../hoisted_note');
const cls = require('../cls');
const protectedSessionService = require('../protected_session');
const log = require('../log');
@@ -88,10 +88,6 @@ function getNoteTitle(childNoteId, parentNoteId) {
function getNoteTitleArrayForPath(notePathArray) {
const titles = [];
if (notePathArray[0] === hoistedNoteService.getHoistedNoteId() && notePathArray.length === 1) {
return [ getNoteTitle(hoistedNoteService.getHoistedNoteId()) ];
}
let parentNoteId = 'root';
let hoistedNotePassed = false;
@@ -103,7 +99,7 @@ function getNoteTitleArrayForPath(notePathArray) {
titles.push(title);
}
if (noteId === hoistedNoteService.getHoistedNoteId()) {
if (noteId === cls.getHoistedNoteId()) {
hoistedNotePassed = true;
}
@@ -130,7 +126,7 @@ function getSomePath(note, path = []) {
path.push(note.noteId);
path.reverse();
if (!path.includes(hoistedNoteService.getHoistedNoteId())) {
if (!path.includes(cls.getHoistedNoteId())) {
return false;
}