Boolean filter improvement alternative: TS upgrade (#4840)

* upgrade typescript and use new feature

* fix: typing error
This commit is contained in:
Dmitrii Kartashev 2024-07-25 19:31:59 -04:00 committed by GitHub
parent 50769b0b6f
commit 4437b9a557
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 10 deletions

View file

@ -74,7 +74,9 @@ function DialogContent({
const onPressAudience = (setting: ThreadgateSetting) => {
// remove nobody
let newSelected = draft.filter(v => v.type !== 'nobody')
let newSelected: ThreadgateSetting[] = draft.filter(
v => v.type !== 'nobody',
)
// toggle
const i = newSelected.findIndex(v => isEqual(v, setting))
if (i === -1) {