mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 12:00:10 +08:00
Properly save when manually choosing layout
This commit is contained in:
parent
575810f660
commit
db2de0c7b7
3 changed files with 11 additions and 3 deletions
|
@ -1510,7 +1510,7 @@ if (Object.keys(layouts).length > 0) {
|
|||
id: "changeLayout" + capitalizeFirstLetter(layout),
|
||||
display: layout.replace(/_/g, " "),
|
||||
exec: () => {
|
||||
changeLayout(layout);
|
||||
changeSavedLayout(layout);
|
||||
restartTest();
|
||||
saveConfigToCookie();
|
||||
},
|
||||
|
|
|
@ -229,7 +229,7 @@ settingsGroups.capsLockBackspace = new SettingsGroup(
|
|||
"capsLockBackspace",
|
||||
setCapsLockBackspace
|
||||
);
|
||||
settingsGroups.layout = new SettingsGroup("layout", changeLayout);
|
||||
settingsGroups.layout = new SettingsGroup("layout", changeSavedLayout);
|
||||
settingsGroups.language = new SettingsGroup("language", changeLanguage);
|
||||
settingsGroups.fontSize = new SettingsGroup("fontSize", changeFontSize);
|
||||
settingsGroups.pageWidth = new SettingsGroup("pageWidth", setPageWidth);
|
||||
|
|
|
@ -167,7 +167,7 @@ function applyConfig(configObj) {
|
|||
changeWordCount(configObj.words, true);
|
||||
changeLanguage(configObj.language, true);
|
||||
setCapsLockBackspace(configObj.capsLockBackspace, true);
|
||||
changeLayout(configObj.savedLayout, true);
|
||||
changeSavedLayout(configObj.savedLayout, true);
|
||||
changeFontSize(configObj.fontSize, true);
|
||||
setFreedomMode(configObj.freedomMode, true);
|
||||
setCaretStyle(configObj.caretStyle, true);
|
||||
|
@ -1181,6 +1181,14 @@ function changeLayout(layout, nosave) {
|
|||
if (!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
function changeSavedLayout(layout, nosave) {
|
||||
if (layout == null || layout == undefined) {
|
||||
layout = "qwerty";
|
||||
}
|
||||
config.savedLayout = layout;
|
||||
changeLayout(layout, nosave);
|
||||
}
|
||||
|
||||
function changeKeymapMode(mode, nosave) {
|
||||
if (mode == null || mode == undefined) {
|
||||
mode = "off";
|
||||
|
|
Loading…
Reference in a new issue