mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-12 10:24:20 +08:00
stopping graph animation, clearing graphs on test init
This commit is contained in:
parent
0c5f1144c5
commit
06ff9c9a4b
1 changed files with 9 additions and 2 deletions
|
|
@ -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("");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue