mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
fix(leftpaneVisibility): Make leftpane visibility switch no longer depend on entitiesReloadedEvent
This commit is contained in:
@@ -35,13 +35,9 @@ export default class LeftPaneToggleWidget extends CommandButtonWidget {
|
||||
super.refreshIcon();
|
||||
splitService.setupLeftPaneResizer(this.currentLeftPaneVisible);
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||
if (loadResults.isOptionReloaded("leftPaneVisible") && document.hasFocus()) {
|
||||
// options.is("leftPaneVisible") changed — it may or may not be the same as currentLeftPaneVisible, but as long as the window is focused, the left pane visibility should be toggled.
|
||||
// See PR description for detailed explanation of multi-window edge cases: https://github.com/TriliumNext/Notes/pull/1962
|
||||
this.currentLeftPaneVisible = !this.currentLeftPaneVisible;
|
||||
this.refreshIcon();
|
||||
}
|
||||
|
||||
setLeftPaneVisibilityEvent({ leftPaneVisible }: EventData<"setLeftPaneVisibility">) {
|
||||
this.currentLeftPaneVisible = leftPaneVisible ?? !this.currentLeftPaneVisible;
|
||||
this.refreshIcon();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user