Don't check for latency if it doesn't exist yet

This commit is contained in:
rijkvanzanten
2020-10-14 17:42:43 -04:00
parent 9c5b95b392
commit f46858cf1e

View File

@@ -22,6 +22,7 @@ export default defineComponent({
});
const avgLatency = computed(() => {
if (!latencyStore.state.latency || latencyStore.state.latency.length === 0) return 0;
const sorted = sortBy(latencyStore.state.latency, ['timestamp']);
const lastFive = sorted.slice(Math.max(sorted.length - 5, 0));
let total = 0;