From 06ff9c9a4bf6b86fafdaa35e2039c433c424187f Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 21 Jan 2021 18:51:37 +0000 Subject: [PATCH] stopping graph animation, clearing graphs on test init --- src/js/tribe.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/js/tribe.js b/src/js/tribe.js index 077d83a47..58a105ba4 100644 --- a/src/js/tribe.js +++ b/src/js/tribe.js @@ -484,7 +484,7 @@ function updateAllGraphs(graphs, max) { graph.options.scales.yAxes[0].ticks.max = Math.round(max); graph.options.scales.yAxes[1].ticks.max = Math.round(max); } - graph.update(); + graph.update({ duration: 0 }); }); } @@ -517,11 +517,17 @@ function drawMinigraph(sid, result) { graph.data.datasets[1].borderColor = themeColors.sub; graph.data.datasets[1].pointBackgroundColor = themeColors.sub; - graph.update(); + graph.update({ duration: 0 }); graphs.push(graph); } +function destroyAllGraphs(graphs) { + graphs.forEach((graph) => { + graph.destroy(); + }); +} + MP.socket.on("connect", (f) => { MP.state = 1; MP.reconnectionAttempts = 0; @@ -756,6 +762,7 @@ MP.socket.on("mp_room_finishTimer_over", (data) => { MP.socket.on("mp_room_test_init", (data) => { mp_playSound("start"); MP.room.testStats = {}; + destroyAllGraphs(); seedrandom(data.seed, { global: true }); mp_refreshTestUserList(); changePage("");