mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-28 09:43:13 +00:00
clear interval
This commit is contained in:
parent
4f63cf7b1f
commit
d36a30d134
1 changed files with 7 additions and 2 deletions
|
|
@ -41,6 +41,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
|
||||
reloadInterval: null,
|
||||
|
||||
config: null,
|
||||
peers: {},
|
||||
selectedPeer: null,
|
||||
|
|
@ -51,9 +53,13 @@ export default {
|
|||
};
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
||||
clearInterval(this.reloadInterval);
|
||||
|
||||
// stop listening for websocket messages
|
||||
WebSocketConnection.off("message", this.onWebsocketMessage);
|
||||
GlobalEmitter.off("compose-new-message", this.onComposeNewMessage);
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
|
@ -65,9 +71,8 @@ export default {
|
|||
this.getConversations();
|
||||
this.getLxmfDeliveryAnnounces();
|
||||
|
||||
// fixme: clear interval on unmount
|
||||
// update info every few seconds
|
||||
setInterval(() => {
|
||||
this.reloadInterval = setInterval(() => {
|
||||
this.getConversations();
|
||||
}, 3000);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue