Skip to content

Commit 86eb3b7

Browse files
author
NarrowsProjects
committed
chore: fix toggleFilter isempty implementation
1 parent 6364e5a commit 86eb3b7

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/public/components/Filters/common/filters/ToggleFilterModel.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ export class ToggleFilterModel extends SelectionModel {
5151
}
5252

5353
/**
54-
* By default, a value of `false` is treated as an empty state, meaning
55-
* the filter is effectively not applied when toggled off.
54+
* Determines whether the current value should be considered empty.
5655
*
57-
* However, if the model was constructed with `falseIsEmpty = true`,
58-
* then `false` is treated as a valid (non-empty) selection, and this
59-
* method will always return `false`.
56+
* By default (`falseIsEmpty = false`), this model never treats its value
57+
* as empty—both `true` and `false` are considered valid selections.
58+
*
59+
* If `falseIsEmpty = true`, then a value of `false` is treated as empty.
6060
*
6161
* @return {boolean} `true` if the current value is considered empty,
6262
* otherwise `false`.
6363
*/
6464
get isEmpty() {
65-
if (!this._falseIsEmpty) {
65+
if (this._falseIsEmpty) {
6666
return this.current === false;
6767
}
6868

lib/public/views/LhcFills/Overview/LhcFillsOverviewModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class LhcFillsOverviewModel extends OverviewPageModel {
3939
fillNumbers: new RawTextFilterModel(),
4040
beamDuration: new TextComparisonFilterModel(),
4141
runDuration: new TextComparisonFilterModel(),
42-
hasStableBeams: new ToggleFilterModel(stableBeamsOnly),
42+
hasStableBeams: new ToggleFilterModel(stableBeamsOnly, true),
4343
stableBeamsStart: new TimeRangeFilterModel(),
4444
stableBeamsEnd: new TimeRangeFilterModel(),
4545
beamTypes: new BeamTypeFilterModel(),

0 commit comments

Comments
 (0)