Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix: avoid query when components are destroyed
Browse files Browse the repository at this point in the history
Closes: #357
  • Loading branch information
rayrutjes committed Nov 11, 2017
1 parent 0192ad9 commit c41c606
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
},
destroyed() {
this.searchStore.stop();
this.searchStore.removeFacet(this.attribute);
this.searchStore.start();
},
};
</script>
2 changes: 2 additions & 0 deletions src/components/RangeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export default {
},
destroyed() {
this.searchStore.stop();
this.searchStore.removeFacet(this.attributeName);
this.searchStore.start();
},
computed: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Rating.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default {
this.searchStore.addFacet(this.attributeName, FACET_OR);
},
destroyed() {
this.searchStore.stop();
this.searchStore.removeFacet(this.attributeName);
this.searchStore.start();
},
computed: {
show() {
Expand Down
2 changes: 2 additions & 0 deletions src/components/RefinementList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export default {
this.searchStore.addFacet(this.attributeName, this.operator);
},
destroyed() {
this.searchStore.stop();
this.searchStore.removeFacet(this.attributeName);
this.searchStore.start();
},
computed: {
facetValues() {
Expand Down
2 changes: 2 additions & 0 deletions src/components/TreeMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export default {
);
},
destroyed() {
this.searchStore.stop();
this.searchStore.removeFacet(this.attribute);
this.searchStore.start();
},
computed: {
facetValues() {
Expand Down
2 changes: 2 additions & 0 deletions src/components/__tests__/menu-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const addFacet = jest.fn();
const searchStore = {
getFacetValues,
addFacet,
stop: () => {},
start: () => {},
};

test('renders proper HTML', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/__tests__/refinement-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const addFacet = jest.fn();
const searchStore = {
getFacetValues,
addFacet,
stop: () => {},
start: () => {},
};

test('renders proper HTML', () => {
Expand Down

0 comments on commit c41c606

Please sign in to comment.