Skip to content

Commit

Permalink
Fix: Gym Graph race condition where the dark mode toggle didn't yet e…
Browse files Browse the repository at this point in the history
…xist (only reproduced on FF) (#807)

Co-authored-by: Sashank <76554862+Sashank999@users.noreply.github.com>
  • Loading branch information
Kwack-Kwack and Sashank999 authored Sep 15, 2024
1 parent 2da6db5 commit ad7fc8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"date": false,
"logs": {
"features": [],
"fixes": [{ "message": "Copy Post for Discord not working due to layout changes.", "contributor": "TheFoxMan" }],
"fixes": [
{ "message": "Copy Post for Discord not working due to layout changes.", "contributor": "TheFoxMan" },
{ "message": "Fixed a race condition breaking the Gym Graph on Firefox", "contributor": "Kwack" }
],
"changes": [],
"removed": []
}
Expand Down
4 changes: 2 additions & 2 deletions extension/scripts/features/gym-graph/ttGymGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@
const gymChart = createChart();

// If Torn dark mode is toggled.
document.find("#dark-mode-state").addEventListener("change", (event) => {
await requireElement("#dark-mode-state").then((el) => el.addEventListener("change", (event) => {
const color = event.target.checked ? "#fff" : "#000";
gymChart.options.scales.x.ticks.color = color;
gymChart.options.scales.y.ticks.color = color;
gymChart.options.plugins.legend.labels.color = color;
gymChart.update();
});
}));

showLoadingPlaceholder(wrapper, false);

Expand Down

0 comments on commit ad7fc8f

Please sign in to comment.