Skip to content

Commit

Permalink
correctly format uppercase options
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-luger committed May 25, 2024
1 parent dc3a8de commit 384156d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions components/ItemFilter/ItemFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { FilterType, hasFlag } from '../FilterElement/FilterType'
import { Typeahead, TypeaheadRef } from 'react-bootstrap-typeahead'
import styles from './ItemFilter.module.css'
import { btoaUnicode } from '../../utils/Base64Utils'
import { ITEM_FILTER_USE_COUNT, LAST_USED_FILTER, getSetting, getSettingsObject, setSetting } from '../../utils/SettingsUtils'
import { ITEM_FILTER_USE_COUNT, LAST_USED_FILTER, getSettingsObject, setSetting } from '../../utils/SettingsUtils'
import ModAdvert from './ModAdvert'
import { isClientSideRendering } from '../../utils/SSRUtils'
import { usePathname, useRouter } from 'next/navigation'
Expand Down Expand Up @@ -430,15 +430,17 @@ function ItemFilter(props: Props) {
let matchingOptions = options.options.filter(option => option.toLowerCase().includes(searchString))

if (matchingOptions.length > 0) {
optionsString =
matchingOptions
.map(option => {
if (option.toLowerCase() === option) {
return convertTagToName(option).trim()
}
return camelCaseToSentenceCase(option).trim()
})
.join(', ')
optionsString = matchingOptions
.map(option => {
if (option.toLowerCase() === option) {
return convertTagToName(option).trim()
}
if (option.toUpperCase() === option) {
return convertTagToName(option).trim()
}
return camelCaseToSentenceCase(option).trim()
})
.join(', ')
}
}

Expand Down

0 comments on commit 384156d

Please sign in to comment.