From ef9cd0e0ad6e45b8a3efec6f3858b3d69d42f619 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 9 Jan 2026 01:47:51 +0400 Subject: [PATCH] refac --- backend/open_webui/routers/auths.py | 4 +--- src/lib/components/layout/Sidebar/Folders/FolderModal.svelte | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/routers/auths.py b/backend/open_webui/routers/auths.py index 63032d71d..32e62526f 100644 --- a/backend/open_webui/routers/auths.py +++ b/backend/open_webui/routers/auths.py @@ -1045,9 +1045,7 @@ async def update_admin_config( request.app.state.config.ENABLE_FOLDERS = form_data.ENABLE_FOLDERS request.app.state.config.FOLDER_MAX_FILE_COUNT = ( - int(form_data.FOLDER_MAX_FILE_COUNT) - if form_data.FOLDER_MAX_FILE_COUNT - else None + int(form_data.FOLDER_MAX_FILE_COUNT) if form_data.FOLDER_MAX_FILE_COUNT else "" ) request.app.state.config.ENABLE_CHANNELS = form_data.ENABLE_CHANNELS request.app.state.config.ENABLE_MEMORIES = form_data.ENABLE_MEMORIES diff --git a/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte b/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte index 48bbaa08a..f1d097528 100644 --- a/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte +++ b/src/lib/components/layout/Sidebar/Folders/FolderModal.svelte @@ -43,8 +43,8 @@ } // Check folder max file count limit - const maxFileCount = $config?.features?.folder_max_file_count ?? null; - if (maxFileCount !== null && (data?.files ?? []).length > maxFileCount) { + const maxFileCount = $config?.features?.folder_max_file_count ?? ''; + if (maxFileCount && (data?.files ?? []).length > maxFileCount) { toast.error( $i18n.t('Maximum number of files per folder is {{max}}.', { max: maxFileCount ?? 0 }) );