Skip to content

Commit

Permalink
Do not always call filter/sort/group on comparison change
Browse files Browse the repository at this point in the history
For the comparison filters make sure that we confirm that the first option and
operator have been set before trying to update any filtering.
  • Loading branch information
Brianna Major committed Jan 29, 2025
1 parent 4a7badc commit 570dbf8
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ export default Vue.extend({
userSelections() {
return [
...store.filterBy,
this.firstComparison,
this.secondComparison,
this.booleanOperator,
...this.sortBy,
...this.groupBy
];
},
comparisonSelections() {
return [this.firstComparison, this.booleanOperator, this.secondComparison];
}
},
watch: {
Expand All @@ -155,11 +155,12 @@ export default Vue.extend({
}
this.$nextTick(() => this.updateObserved());
},
firstComparison() {
this.showFlags = !!this.firstComparison && !!this.booleanOperator;
},
booleanOperator() {
comparisonSelections(_newComps, oldComps) {
const [oldFirst, oldBoolean] = oldComps;
this.showFlags = !!this.firstComparison && !!this.booleanOperator;
if (this.showFlags || (oldFirst && oldBoolean)) {
this.updateFilteredSortedGroupedSuperpixels();
}
},
userSelections() {
this.updateFilteredSortedGroupedSuperpixels();
Expand Down Expand Up @@ -473,7 +474,7 @@ export default Vue.extend({
results = this.filterBySlideName(results, filterBy);
}
if (!!this.firstComparison && !!this.booleanOperator) {
results = this.filterByComparison(data);
results = this.filterByComparison(results);
}
filterBy = getFilters('labeler_');
if (filterBy.length > 0) {
Expand Down

0 comments on commit 570dbf8

Please sign in to comment.