mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 20:40:48 +08:00
fixes
This commit is contained in:
parent
18adf9bf49
commit
aa2b0eece8
2 changed files with 25 additions and 23 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue