mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-01 21:15:15 +08:00
catching any errors while drawing minigraph
This commit is contained in:
parent
4b0c91bc7d
commit
565e998667
1 changed files with 8 additions and 4 deletions
|
|
@ -646,12 +646,16 @@ function fillGraphDataAndUpdate(graph, result, sid) {
|
|||
}
|
||||
|
||||
function drawMinigraph(sid, result) {
|
||||
let graphelem = $(`.tribeResult .player[sid='${sid}'] .graph canvas`)[0];
|
||||
let graph = new Chart(graphelem, miniChartSettings);
|
||||
try {
|
||||
let graphelem = $(`.tribeResult .player[sid='${sid}'] .graph canvas`)[0];
|
||||
let graph = new Chart(graphelem, miniChartSettings);
|
||||
|
||||
fillGraphDataAndUpdate(graph, result, sid);
|
||||
fillGraphDataAndUpdate(graph, result, sid);
|
||||
|
||||
return graph;
|
||||
return graph;
|
||||
} catch (e) {
|
||||
Notifications.add("Error drawing mini graph: " + e.message, -1);
|
||||
}
|
||||
}
|
||||
|
||||
function destroyAllGraphs() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue