mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-21 20:03:08 +00:00
Fix Record|Map label lookup typing for the leadership filter summary.
Narrow after the Map check so tsc accepts Record index access on the push gate.
This commit is contained in:
parent
aa11262104
commit
e87c0aa059
1 changed files with 2 additions and 1 deletions
|
|
@ -147,7 +147,8 @@ const municipalityLabel = (
|
||||||
): string => {
|
): string => {
|
||||||
if (!labels) return `Município #${id}`
|
if (!labels) return `Município #${id}`
|
||||||
if (labels instanceof Map) return labels.get(id) ?? `Município #${id}`
|
if (labels instanceof Map) return labels.get(id) ?? `Município #${id}`
|
||||||
return labels[id] ?? `Município #${id}`
|
const record = labels as Readonly<Record<number, string>>
|
||||||
|
return record[id] ?? `Município #${id}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const formatLeadershipActiveFiltersSummary = (
|
export const formatLeadershipActiveFiltersSummary = (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue