mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 18:04:27 +08:00
version bump, syncing config when changing min acc wpm punc and numbers
This commit is contained in:
parent
14ccb6d970
commit
c2b3f998ea
3 changed files with 12 additions and 4 deletions
|
|
@ -5738,7 +5738,8 @@ if (firebase.app().options.projectId === "monkey-type-dev-67af4") {
|
|||
);
|
||||
}
|
||||
|
||||
if (window.location.hostname === "localhost") {
|
||||
if (firebase.app().options.projectId === "monkey-type-dev-67af4") {
|
||||
// if (window.location.hostname === "localhost") {
|
||||
window.onerror = function (error) {
|
||||
Notifications.add(error, -1);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ let MP = {
|
|||
maxReconnectionAttempts: 1,
|
||||
activePage: "preloader",
|
||||
pageTransition: false,
|
||||
expectedVersion: "0.7.0",
|
||||
expectedVersion: "0.7.1",
|
||||
};
|
||||
|
||||
let tribeSounds = {
|
||||
|
|
@ -140,12 +140,12 @@ function mp_applyRoomConfig(cfg) {
|
|||
setPunctuation(cfg.punctuation, true, true);
|
||||
setNumbers(cfg.numbers, true, true);
|
||||
if (cfg.minAcc != null) {
|
||||
setMinAcc("custom", true, true);
|
||||
setMinAccCustom(cfg.minAcc, true, true);
|
||||
setMinAcc("custom", true, true);
|
||||
}
|
||||
if (cfg.minWpm != null) {
|
||||
setMinWpm("custom", true, true);
|
||||
setMinWpmCustomSpeed(cfg.minAcc, true, true);
|
||||
setMinWpm("custom", true, true);
|
||||
}
|
||||
customText = cfg.customText;
|
||||
}
|
||||
|
|
@ -659,6 +659,7 @@ MP.socket.on("mp_update_online_stats", (data) => {
|
|||
);
|
||||
if (data.version !== MP.expectedVersion) {
|
||||
MP.socket.disconnect();
|
||||
mp_changeActiveSubpage("preloader");
|
||||
Notifications.add(
|
||||
`Tribe version mismatch. Try refreshing or clearing cache. Client version: ${MP.expectedVersion}, server version: ${data.version}`,
|
||||
-1
|
||||
|
|
|
|||
|
|
@ -434,6 +434,7 @@ function setMinWpm(minwpm, nosave, mp = false) {
|
|||
}
|
||||
config.minWpm = minwpm;
|
||||
updateTestModesNotice();
|
||||
mp_syncConfig();
|
||||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
|
|
@ -445,6 +446,7 @@ function setMinWpmCustomSpeed(val, nosave, mp = false) {
|
|||
val = 100;
|
||||
}
|
||||
config.minWpmCustomSpeed = val;
|
||||
mp_syncConfig();
|
||||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
|
|
@ -458,6 +460,7 @@ function setMinAcc(min, nosave, mp = false) {
|
|||
}
|
||||
config.minAcc = min;
|
||||
updateTestModesNotice();
|
||||
mp_syncConfig();
|
||||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
|
|
@ -469,6 +472,7 @@ function setMinAccCustom(val, nosave, mp = false) {
|
|||
val = 90;
|
||||
}
|
||||
config.minAccCustom = val;
|
||||
mp_syncConfig();
|
||||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
|
|
@ -958,6 +962,7 @@ function setNumbers(numb, nosave, mp = false) {
|
|||
} else {
|
||||
$("#top .config .numbersMode .text-button").addClass("active");
|
||||
}
|
||||
mp_syncConfig();
|
||||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
|
|
@ -982,6 +987,7 @@ function setPunctuation(punc, nosave, mp = false) {
|
|||
} else {
|
||||
$("#top .config .punctuationMode .text-button").addClass("active");
|
||||
}
|
||||
mp_syncConfig();
|
||||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue