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