From 48ed096ac1d99a0c44dae2b7f225255dfe51e560 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Mon, 12 May 2025 14:03:58 +0200 Subject: [PATCH] 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 --- frontend/src/ts/pages/settings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/pages/settings.ts b/frontend/src/ts/pages/settings.ts index 7607a576f..bfd65a8da 100644 --- a/frontend/src/ts/pages/settings.ts +++ b/frontend/src/ts/pages/settings.ts @@ -580,7 +580,7 @@ async function fillSettingsPage(): Promise { 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 { customPolyglotSelect = new SlimSelect({ select: ".pageSettings .section[data-config-name='customPolyglot'] select", + settings: { minSelected: 1 }, data: getLanguageDropdownData((language) => Config.customPolyglot.includes(language) ),