Skip to content

Commit

Permalink
Merge pull request #12296 from rak-phillip/bugfix/12292-hook-cleanup
Browse files Browse the repository at this point in the history
Replace `beforeDestroy` lifecycle option with `beforeUnmount`
  • Loading branch information
rak-phillip authored Oct 22, 2024
2 parents 6c1b61a + 63e3ce2 commit 4e82a4d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion shell/components/SortableTable/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
};
},

beforeDestroy() {
beforeUnmount() {
window.removeEventListener('resize', this.onWindowResize);
},

Expand Down
2 changes: 1 addition & 1 deletion shell/components/SortableTable/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
table.addEventListener('contextmenu', this._onRowContextBound);
},

beforeDestroy() {
beforeUnmount() {
const table = this.$el.querySelector('TABLE');

table.removeEventListener('click', this._onRowClickBound);
Expand Down
2 changes: 1 addition & 1 deletion shell/mixins/browser-tab-visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
mounted() {
this.setTabVisibilityListener(true);
},
beforeDestroy() {
beforeUnmount() {
this.setTabVisibilityListener(false);
},
};
2 changes: 1 addition & 1 deletion shell/mixins/metric-poller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
this.metricPoller.start();
},

beforeDestroy() {
beforeUnmount() {
this.metricPoller.stop();
},
};
2 changes: 1 addition & 1 deletion shell/mixins/resource-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
};
},

beforeDestroy() {
beforeUnmount() {
// make sure this only runs once, for the initialized instance
if (this.init) {
// clear up the store to make sure we aren't storing anything that might interfere with the next rendered list view
Expand Down

0 comments on commit 4e82a4d

Please sign in to comment.