mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 07:38:15 +00:00
make a copy of filters before checking isEqual
- to prevent using same pointer
This commit is contained in:
@ -377,8 +377,11 @@ define([
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
updateFiltersAndRefresh: function (updatedFilters) {
|
updateFiltersAndRefresh: function (updatedFilters) {
|
||||||
if (this.filters && !_.isEqual(this.filters, updatedFilters)) {
|
let deepCopiedFilters = JSON.parse(JSON.stringify(updatedFilters));
|
||||||
this.filters = updatedFilters;
|
|
||||||
|
if (this.filters && !_.isEqual(this.filters, deepCopiedFilters)) {
|
||||||
|
console.log('actually updating');
|
||||||
|
this.filters = deepCopiedFilters;
|
||||||
this.reset();
|
this.reset();
|
||||||
if (this.unsubscribe) {
|
if (this.unsubscribe) {
|
||||||
this.unsubscribe();
|
this.unsubscribe();
|
||||||
@ -386,7 +389,7 @@ define([
|
|||||||
}
|
}
|
||||||
this.fetch();
|
this.fetch();
|
||||||
} else {
|
} else {
|
||||||
this.filters = updatedFilters;
|
this.filters = deepCopiedFilters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user