mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-28 00:20:48 +00:00
more cleanup
This commit is contained in:
parent
5fd3e72661
commit
bf955f6854
3 changed files with 15 additions and 13 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -127,8 +127,6 @@ export default {
|
|||
formatBytes: function(bytes) {
|
||||
return Utils.formatBytes(bytes);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
isElectron() {
|
||||
return ElectronUtils.isElectron();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -186,18 +186,21 @@ export default {
|
|||
return {
|
||||
interfaces: {},
|
||||
interfaceStats: {},
|
||||
reloadInterval: null,
|
||||
};
|
||||
},
|
||||
beforeUnmount() {
|
||||
clearInterval(this.reloadInterval);
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.loadInterfaces();
|
||||
this.updateInterfaceStats();
|
||||
|
||||
// fixme: clear interval on unmount
|
||||
// update info every few seconds
|
||||
setInterval(() => {
|
||||
this.reloadInterval = setInterval(() => {
|
||||
this.updateInterfaceStats();
|
||||
}, 3000);
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -209,13 +212,8 @@ export default {
|
|||
},
|
||||
async loadInterfaces() {
|
||||
try {
|
||||
|
||||
// fetch interfaces
|
||||
const response = await window.axios.get(`/api/v1/reticulum/interfaces`);
|
||||
|
||||
// update ui
|
||||
this.interfaces = response.data.interfaces;
|
||||
|
||||
} catch(e) {
|
||||
// do nothing if failed to load interfaces
|
||||
}
|
||||
|
|
@ -352,11 +350,11 @@ export default {
|
|||
formatBytes: function(bytes) {
|
||||
return Utils.formatBytes(bytes);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
isElectron() {
|
||||
return ElectronUtils.isElectron();
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
interfacesWithStats() {
|
||||
const results = [];
|
||||
for(const [interfaceName, iface] of Object.entries(this.interfaces)){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue