fix: only require one click to toggle stack components
This commit is contained in:
@@ -1080,15 +1080,13 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
this.application.componentManager!.contextItemDidChangeInArea(ComponentArea.NoteTags);
|
this.application.componentManager!.contextItemDidChangeInArea(ComponentArea.NoteTags);
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadStackComponents() {
|
async reloadStackComponents() {
|
||||||
this.setState({
|
const stackComponents = sortAlphabetically(
|
||||||
stackComponents: sortAlphabetically(
|
this.application.componentManager!.componentsForArea(ComponentArea.EditorStack)
|
||||||
this.application.componentManager!.componentsForArea(ComponentArea.EditorStack)
|
.filter(component => component.active)
|
||||||
.filter(component => component.active)
|
);
|
||||||
)
|
|
||||||
});
|
|
||||||
if (this.note) {
|
if (this.note) {
|
||||||
for (const component of this.state.stackComponents) {
|
for (const component of stackComponents) {
|
||||||
if (component.active) {
|
if (component.active) {
|
||||||
this.application.componentManager!.setComponentHidden(
|
this.application.componentManager!.setComponentHidden(
|
||||||
component,
|
component,
|
||||||
@@ -1097,6 +1095,7 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await this.setState({ stackComponents });
|
||||||
this.application.componentManager!.contextItemDidChangeInArea(ComponentArea.EditorStack);
|
this.application.componentManager!.contextItemDidChangeInArea(ComponentArea.EditorStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user