_hidden note does not inherit attributes from root, fixes #3537

This commit is contained in:
zadam 2023-01-17 22:14:53 +01:00
parent a5e21ea5f3
commit 2fa1d812f6
2 changed files with 6 additions and 3 deletions

View File

@ -401,7 +401,8 @@ class BNote extends AbstractBeccaEntity {
const parentAttributes = this.ownedAttributes.slice();
const newPath = [...path, this.noteId];
if (this.noteId !== 'root') {
// inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
if (this.noteId !== 'root' && this.noteId !== '_hidden') {
for (const parentNote of this.parents) {
parentAttributes.push(...parentNote.__getInheritableAttributes(newPath));
}
@ -852,7 +853,8 @@ class BNote extends AbstractBeccaEntity {
const set = new Set();
function inner(note) {
if (set.has(note)) {
// _hidden is not counted as subtree for the purpose of inheritance
if (set.has(note) || note.noteId === '_hidden') {
return;
}

View File

@ -250,7 +250,8 @@ class FNote {
const newPath = [...path, this.noteId];
const attrArrs = [ this.getOwnedAttributes() ];
if (this.noteId !== 'root') {
// inheritable attrs on root are typically not intended to be applied to hidden subtree #3537
if (this.noteId !== 'root' && this.noteId !== '_hidden') {
for (const parentNote of this.getParentNotes()) {
// these virtual parent-child relationships are also loaded into froca
if (parentNote.type !== 'search') {