From e14f5249d2da47413edb0fccc04e9785cae63b4a Mon Sep 17 00:00:00 2001 From: Petard Jonson <41122242+greenhat616@users.noreply.github.com> Date: Fri, 30 Aug 2024 21:13:52 +0800 Subject: [PATCH] fix: dont merge falsy theme settings fix: dont merge falsy theme settings --- .../nyanpasu/src/components/layout/use-custom-theme.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/nyanpasu/src/components/layout/use-custom-theme.tsx b/frontend/nyanpasu/src/components/layout/use-custom-theme.tsx index 018bb76f30..7e01638239 100644 --- a/frontend/nyanpasu/src/components/layout/use-custom-theme.tsx +++ b/frontend/nyanpasu/src/components/layout/use-custom-theme.tsx @@ -46,11 +46,9 @@ export const useCustomTheme = () => { mergeWith( {}, defaultTheme, - nyanpasuConfig?.theme_setting, + nyanpasuConfig?.theme_setting || {}, (objValue, srcValue) => { - return srcValue === undefined || srcValue === "" - ? objValue - : srcValue; + return !srcValue ? objValue : srcValue; }, ), );