fix navbar crash (#22212)

This commit is contained in:
Dhruv Parmar 2025-07-08 17:03:08 +05:30 committed by GitHub
parent be2ed5ff62
commit 20107efd48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -511,7 +511,8 @@ const NavBar = () => {
<Button
className="flex-center gap-2 p-x-xs font-medium"
type="text">
{upperCase(language.split('-')[0])} <DropDownIcon width={12} />
{language ? upperCase(language.split('-')[0]) : ''}{' '}
<DropDownIcon width={12} />
</Button>
</Dropdown>
<Dropdown

View File

@ -98,7 +98,9 @@ export const useCurrentUserPreferences = () => {
}
return {
preferences: preferences[currentUser.name] || defaultPreferences,
preferences: preferences[currentUser.name]
? { ...defaultPreferences, ...preferences[currentUser.name] }
: defaultPreferences,
setPreference: (newPreferences: Partial<UserPreferences>) =>
setUserPreference(currentUser.name, newPreferences),
};