Skip to content

Commit

Permalink
fix(server): config saving with layout that includes a dash (mart-e) (#…
Browse files Browse the repository at this point in the history
…5193)

* [FIX] Accept layout with dash

At least seht-drai and ergo-l is not compatible

* add regex

---------

Co-authored-by: Miodec <jack@monkeytype.com>
  • Loading branch information
mart-e and Miodec authored Mar 11, 2024
1 parent 9aeaa31 commit 1bb0bdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/src/api/schemas/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ const CONFIG_SCHEMA = joi.object({
keymapLegendStyle: joi
.string()
.valid("lowercase", "uppercase", "blank", "dynamic"),
keymapLayout: joi.string().valid().max(50).token(),
keymapLayout: joi
.string()
.regex(/[\w-_]+/)
.valid()
.max(50),
keymapShowTopRow: joi.string().valid("always", "layout", "never"),
fontFamily: joi
.string()
Expand Down

0 comments on commit 1bb0bdf

Please sign in to comment.