mirror of
https://github.com/fsolla/teqo.git
synced 2026-12-01 20:13:04 +00:00
fix: avoid never-narrow on multi filter param
This commit is contained in:
parent
3dbbc5b203
commit
96e03f0c26
1 changed files with 7 additions and 19 deletions
|
|
@ -110,25 +110,13 @@ export const buildMunicipalityMobileFilterOptions = ({
|
||||||
if (definition.param === 'advisor') filterOptions = advisorFilterOptions
|
if (definition.param === 'advisor') filterOptions = advisorFilterOptions
|
||||||
if (filterOptions.length === 0) continue
|
if (filterOptions.length === 0) continue
|
||||||
|
|
||||||
const param = ((): MunicipalityMultiFilterParam => {
|
let param: MunicipalityMultiFilterParam
|
||||||
switch (definition.param) {
|
if (definition.param === 'region') param = 'region'
|
||||||
case 'region':
|
else if (definition.param === 'advisor') param = 'advisor'
|
||||||
return 'region'
|
else if (definition.param === 'trend') param = 'trend'
|
||||||
case 'advisor':
|
else if (definition.param === 'class') param = 'class'
|
||||||
return 'advisor'
|
else if (definition.param === 'level') param = 'level'
|
||||||
case 'trend':
|
else continue // `name` skipped above; `coverage` is toggle-only
|
||||||
return 'trend'
|
|
||||||
case 'class':
|
|
||||||
return 'class'
|
|
||||||
case 'level':
|
|
||||||
return 'level'
|
|
||||||
default: {
|
|
||||||
// `name` is skipped above; `coverage` is toggle-only.
|
|
||||||
const _exhaustive: never = definition.param
|
|
||||||
return _exhaustive
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
|
|
||||||
const selected = new Set(getMunicipalityMultiFilterValues(state, param))
|
const selected = new Set(getMunicipalityMultiFilterValues(state, param))
|
||||||
for (const option of filterOptions) {
|
for (const option of filterOptions) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue