mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-02 21:42:15 +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;
|
||||
|
||||
this.tree.getRootNode().visit((node) => {
|
||||
if (node.isExpanded() && !noteIdsToKeepExpanded.has(node.data.noteId)) {
|
||||
node.setExpanded(false);
|
||||
if (!options.is("databaseReadonly")) {
|
||||
// can't change expanded notes when database is readonly
|
||||
this.tree.getRootNode().visit((node) => {
|
||||
if (node.isExpanded() && !noteIdsToKeepExpanded.has(node.data.noteId)) {
|
||||
node.setExpanded(false);
|
||||
|
||||
if (noneCollapsedYet) {
|
||||
toastService.showMessage(t("note_tree.auto-collapsing-notes-after-inactivity"));
|
||||
noneCollapsedYet = false;
|
||||
if (noneCollapsedYet) {
|
||||
toastService.showMessage(t("note_tree.auto-collapsing-notes-after-inactivity"));
|
||||
noneCollapsedYet = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
}, false);
|
||||
}
|
||||
|
||||
this.filterHoistedBranch(true);
|
||||
}, 600 * 1000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user