mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-09 23:25:53 +08:00
impr(settings): prevent customLayoutFluid and customPolyglot to be empty (@fehmer) (#6548)
Prevent user from deselecting all layouts/languages in customLayoutfluid and customPolyglot selects. Fixes FRONTEND-MW and FRONTEND-MS
This commit is contained in:
parent
f1f4d17932
commit
48ed096ac1
1 changed files with 2 additions and 1 deletions
|
@ -580,7 +580,7 @@ async function fillSettingsPage(): Promise<void> {
|
|||
customLayoutFluidSelect = new SlimSelect({
|
||||
select:
|
||||
".pageSettings .section[data-config-name='customLayoutfluid'] select",
|
||||
settings: { keepOrder: true },
|
||||
settings: { keepOrder: true, minSelected: 1 },
|
||||
events: {
|
||||
afterChange: (newVal): void => {
|
||||
const customLayoutfluid = newVal.map(
|
||||
|
@ -598,6 +598,7 @@ async function fillSettingsPage(): Promise<void> {
|
|||
|
||||
customPolyglotSelect = new SlimSelect({
|
||||
select: ".pageSettings .section[data-config-name='customPolyglot'] select",
|
||||
settings: { minSelected: 1 },
|
||||
data: getLanguageDropdownData((language) =>
|
||||
Config.customPolyglot.includes(language)
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue