clear interval on unmount

This commit is contained in:
liamcottle 2024-08-16 15:04:05 +12:00
commit 9e4380bcd4

View file

@ -39,6 +39,7 @@ export default {
config: null,
isLoading: false,
loadingProgress: 0,
reloadInterval: null,
interfaces: [],
pathTable: [],
announces: {},
@ -47,6 +48,9 @@ export default {
edges: new DataSet(),
};
},
beforeUnmount() {
clearInterval(this.reloadInterval);
},
mounted() {
this.init();
},
@ -157,7 +161,7 @@ export default {
this.isLoading = false;
// auto update network
setInterval(() => {
this.reloadInterval = setInterval(() => {
this.update();
}, 10000);