This commit is contained in:
Miodec 2022-02-10 21:24:46 +01:00
parent 18adf9bf49
commit aa2b0eece8
2 changed files with 25 additions and 23 deletions

View file

@ -27,9 +27,9 @@ export let localStorageConfig = null;
export let dbConfigLoaded = false;
export let changedBeforeDb = false;
let eventSubscribers = [];
const eventSubscribers = [];
export function subscribe(fn) {
export function subscribeToEvent(fn) {
eventSubscribers.push(fn);
}
@ -321,7 +321,7 @@ function updateChartAccuracy() {
ChartController.accountHistory.update();
}
export function updateChartStyle() {
function updateChartStyle() {
if (config.chartStyle == "scatter") {
ChartController.accountHistory.data.datasets[0].showLine = false;
ChartController.accountHistory.data.datasets[1].showLine = false;

View file

@ -23,26 +23,28 @@ import * as UI from "../ui";
import * as SlowTimer from "../states/slow-timer";
import * as ReportQuotePopup from "../popups/quote-report-popup";
UpdateConfig.subscribe((key, value) => {
if (
[
"difficulty",
"blindMode",
"stopOnError",
"paceCaret",
"minWpm",
"minAcc",
"minBurst",
"confidenceMode",
"layout",
].includes(key)
) {
updateModesNotice();
}
if (key === "flipTestColors") flipColors(value);
if (key === "colorfulMode") colorful(value);
if (key === "highlightMode") updateWordElement(value);
if (key === "burstHeatmap") applyBurstHeatmap();
$(document).ready(() => {
UpdateConfig.subscribeToEvent((eventKey, eventValue) => {
if (
[
"difficulty",
"blindMode",
"stopOnError",
"paceCaret",
"minWpm",
"minAcc",
"minBurst",
"confidenceMode",
"layout",
].includes(eventKey)
) {
updateModesNotice();
}
if (eventKey === "flipTestColors") flipColors(eventValue);
if (eventKey === "colorfulMode") colorful(eventValue);
if (eventKey === "highlightMode") updateWordElement(eventValue);
if (eventKey === "burstHeatmap") applyBurstHeatmap();
});
});
export let currentWordElementIndex = 0;