mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-02-04 14:39:02 +08:00
storing customlayoutfluid using _ instead of spaces so that it can save the config properly
This commit is contained in:
parent
518ec33189
commit
7fc3b09610
7 changed files with 16 additions and 15 deletions
|
|
@ -1666,12 +1666,12 @@ export let defaultCommands = {
|
|||
UpdateConfig.setCustomLayoutfluid(input);
|
||||
UpdateConfig.setLayout(
|
||||
Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")[0]
|
||||
? Config.customLayoutfluid.split("_")[0]
|
||||
: "qwerty"
|
||||
);
|
||||
UpdateConfig.setKeymapLayout(
|
||||
Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")[0]
|
||||
? Config.customLayoutfluid.split("_")[0]
|
||||
: "qwerty"
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1401,9 +1401,10 @@ export function setCustomBackground(value, nosave) {
|
|||
}
|
||||
|
||||
export function setCustomLayoutfluid(value, nosave) {
|
||||
// scuffed solution
|
||||
if (value == undefined) return;
|
||||
|
||||
if (value == null || value == undefined) {
|
||||
value = "qwerty_dvorak_colemak";
|
||||
}
|
||||
value = value.replace(/ /g, "_");
|
||||
config.customLayoutfluid = value;
|
||||
CommandlineLists.defaultCommands.list.filter(
|
||||
(command) => command.id == "changeCustomLayoutfluid"
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ function handleSpace(event, isEnter) {
|
|||
if (Funbox.active === "layoutfluid" && Config.mode !== "time") {
|
||||
// here I need to check if Config.customLayoutFluid exists because of my scuffed solution of returning whenever value is undefined in the setCustomLayoutfluid function
|
||||
const layouts = Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")
|
||||
? Config.customLayoutfluid.split("_")
|
||||
: ["qwerty", "dvorak", "colemak"];
|
||||
let index = 0;
|
||||
let outof = TestLogic.words.length;
|
||||
|
|
|
|||
|
|
@ -277,10 +277,10 @@ async function initGroups() {
|
|||
"customBackgroundSize",
|
||||
UpdateConfig.setCustomBackgroundSize
|
||||
);
|
||||
groups.customLayoutfluid = new SettingsGroup(
|
||||
"customLayoutfluid",
|
||||
UpdateConfig.setCustomLayoutfluid
|
||||
);
|
||||
// groups.customLayoutfluid = new SettingsGroup(
|
||||
// "customLayoutfluid",
|
||||
// UpdateConfig.setCustomLayoutfluid
|
||||
// );
|
||||
}
|
||||
|
||||
async function fillSettingsPage() {
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ export async function activate(funbox, mode) {
|
|||
rememberSetting("layout", Config.layout, UpdateConfig.setLayout);
|
||||
UpdateConfig.setLayout(
|
||||
Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")[0]
|
||||
? Config.customLayoutfluid.split("_")[0]
|
||||
: "qwerty"
|
||||
);
|
||||
Settings.groups.layout.updateButton();
|
||||
|
|
@ -187,7 +187,7 @@ export async function activate(funbox, mode) {
|
|||
);
|
||||
UpdateConfig.setKeymapLayout(
|
||||
Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")[0]
|
||||
? Config.customLayoutfluid.split("_")[0]
|
||||
: "qwerty"
|
||||
);
|
||||
Settings.groups.keymapLayout.updateButton();
|
||||
|
|
|
|||
|
|
@ -763,12 +763,12 @@ export function restart(withSameWordset = false, nosave = false, event) {
|
|||
if (Funbox.active === "layoutfluid") {
|
||||
UpdateConfig.setLayout(
|
||||
Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")[0]
|
||||
? Config.customLayoutfluid.split("_")[0]
|
||||
: "qwerty"
|
||||
);
|
||||
UpdateConfig.setKeymapLayout(
|
||||
Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")[0]
|
||||
? Config.customLayoutfluid.split("_")[0]
|
||||
: "qwerty"
|
||||
);
|
||||
Keymap.highlightKey(
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export function start() {
|
|||
|
||||
if (Funbox.active === "layoutfluid" && Config.mode === "time") {
|
||||
const layouts = Config.customLayoutfluid
|
||||
? Config.customLayoutfluid.split(" ")
|
||||
? Config.customLayoutfluid.split("_")
|
||||
: ["qwerty", "dvorak", "colemak"];
|
||||
console.log(Config.customLayoutfluid);
|
||||
console.log(layouts);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue