mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-24 00:08:02 +08:00
fix(client): handle read-only in note tree auto-collapse
This commit is contained in:
parent
bd0cb91171
commit
23422731e2
@ -1172,6 +1172,8 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
let noneCollapsedYet = true;
|
let noneCollapsedYet = true;
|
||||||
|
|
||||||
|
if (!options.is("databaseReadonly")) {
|
||||||
|
// can't change expanded notes when database is readonly
|
||||||
this.tree.getRootNode().visit((node) => {
|
this.tree.getRootNode().visit((node) => {
|
||||||
if (node.isExpanded() && !noteIdsToKeepExpanded.has(node.data.noteId)) {
|
if (node.isExpanded() && !noteIdsToKeepExpanded.has(node.data.noteId)) {
|
||||||
node.setExpanded(false);
|
node.setExpanded(false);
|
||||||
@ -1182,6 +1184,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
}
|
||||||
|
|
||||||
this.filterHoistedBranch(true);
|
this.filterHoistedBranch(true);
|
||||||
}, 600 * 1000);
|
}, 600 * 1000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user