Skip to content

Commit 9934e56

Browse files
committed
[O2B-1502] fixed stable beam default value
1 parent c0c8559 commit 9934e56

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/public/components/Filters/LhcFillsFilter/StableBeamFilterModel.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ export class StableBeamFilterModel extends SelectionModel {
2424
*/
2525
constructor(value = false) {
2626
super({ availableOptions: [{ value: true }, { value: false }],
27-
defaultSelection: [{ value: false }],
27+
defaultSelection: [{ value: value }],
2828
multiple: false,
2929
allowEmpty: false });
30-
// Sets filter value to true if
31-
if (value) {
32-
this.setStableBeamsOnly(value);
33-
}
3430
}
3531

3632
/**
@@ -39,8 +35,7 @@ export class StableBeamFilterModel extends SelectionModel {
3935
* @return {boolean} true if filter is stable beams only
4036
*/
4137
isStableBeamsOnly() {
42-
const selectedOptions = this.selected;
43-
return selectedOptions[0] === true;
38+
return this.current;
4439
}
4540

4641
/**
@@ -50,11 +45,7 @@ export class StableBeamFilterModel extends SelectionModel {
5045
* @return {void}
5146
*/
5247
setStableBeamsOnly(value) {
53-
if (value) {
54-
this.select({ value: true });
55-
} else {
56-
this.select({ value: false });
57-
}
48+
this.select({ value });
5849
}
5950

6051
/**

0 commit comments

Comments
 (0)