Skip to content
Snippets Groups Projects
Commit 3dda801c authored by Michal Malý's avatar Michal Malý
Browse files

ReDNATCO plugin stage 25

parent 77491547
Branches
No related tags found
No related merge requests found
...@@ -967,32 +967,40 @@ export class ReDNATCOMspViewer { ...@@ -967,32 +967,40 @@ export class ReDNATCOMspViewer {
} }
async actionApplyFilter(filter: Filters.All) { async actionApplyFilter(filter: Filters.All) {
await this.plugin.state.data.build() const b = this.plugin.state.data.build();
.to(IDs.ID('structure', 'nucleic', BaseRef)) if (this.has('structure', 'nucleic', BaseRef)) {
.update( b.to(IDs.ID('structure', 'nucleic', BaseRef))
StateTransforms.Model.StructureSelectionFromExpression, .update(
old => ({ StateTransforms.Model.StructureSelectionFromExpression,
...old, old => ({
expression: Filtering.toExpression(filter) ...old,
}) expression: Filtering.toExpression(filter)
) })
.to(IDs.ID('structure', 'protein', BaseRef)) );
.update( }
StateTransforms.Model.StructureSelectionFromExpression,
old => ({ if (this.has('structure', 'protein', BaseRef)) {
...old, b.to(IDs.ID('structure', 'protein', BaseRef))
expression: Filtering.toExpression(filter) .update(
}) StateTransforms.Model.StructureSelectionFromExpression,
) old => ({
.to(IDs.ID('structure', 'protein', BaseRef)) ...old,
.update( expression: Filtering.toExpression(filter)
StateTransforms.Model.StructureSelectionFromExpression, })
old => ({ );
...old, }
expression: Filtering.toExpression(filter)
}) if (this.has('structure', 'water', BaseRef)) {
) b.to(IDs.ID('structure', 'water', BaseRef))
.commit(); .update(
StateTransforms.Model.StructureSelectionFromExpression,
old => ({
...old,
expression: Filtering.toExpression(filter)
})
);
}
await b.commit();
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment