more cleanup

This commit is contained in:
liamcottle 2024-08-06 01:31:34 +12:00
parent 5fd3e72661
commit bf955f6854
3 changed files with 15 additions and 13 deletions

View file

@ -267,6 +267,8 @@ export default {
data() {
return {
reloadInterval: null,
isShowingMyIdentitySection: true,
isShowingAnnounceSection: true,
isShowingCallsSection: true,
@ -280,8 +282,12 @@ export default {
};
},
beforeUnmount() {
clearInterval(this.reloadInterval);
// stop listening for websocket messages
WebSocketConnection.off("message", this.onWebsocketMessage);
},
mounted() {
@ -293,7 +299,7 @@ export default {
// fixme: clear interval on unmount
// update info every few seconds
setInterval(() => {
this.reloadInterval = setInterval(() => {
this.updateCallsList();
}, 3000);