Stop updating total stats on unmount
This commit is contained in:
parent
98abe8c20c
commit
c9cfc2c139
@ -65,6 +65,8 @@ export default class Home extends Vue {
|
|||||||
|
|
||||||
uniqueCountries: number;
|
uniqueCountries: number;
|
||||||
|
|
||||||
|
private updaterHandle?: number;
|
||||||
|
|
||||||
ready = false;
|
ready = false;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -120,10 +122,13 @@ export default class Home extends Vue {
|
|||||||
mounted(): void {
|
mounted(): void {
|
||||||
this.updateStats();
|
this.updateStats();
|
||||||
|
|
||||||
setInterval(() => {
|
this.updaterHandle = setInterval(() => {
|
||||||
this.updateStats();
|
this.updateStats();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
unmounted(): void {
|
||||||
|
clearInterval(this.updaterHandle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
Loading…
Reference in New Issue
Block a user