Merge pull request #4898 from h3poteto/fix/firefish-filter

Fix filter method for Firefish
This commit is contained in:
AkiraFukushima 2024-03-15 21:24:49 +09:00 committed by GitHub
commit b9af54e48e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 14 deletions

View File

@ -112,21 +112,26 @@ export default function Timeline(props: Props) {
}, [props.timeline, props.client, props.account])
const loadFilter = async (tl: string, client: MegalodonInterface): Promise<Array<Entity.Filter>> => {
const res = await client.getFilters()
let context = 'home'
switch (tl) {
case 'home':
context = 'home'
break
case 'local':
case 'public':
context = 'public'
break
default:
context = 'home'
break
try {
const res = await client.getFilters()
let context = 'home'
switch (tl) {
case 'home':
context = 'home'
break
case 'local':
case 'public':
context = 'public'
break
default:
context = 'home'
break
}
return res.data.filter(f => f.context.includes(context))
} catch (e) {
console.error(e)
return []
}
return res.data.filter(f => f.context.includes(context))
}
const loadTimeline = async (tl: string, client: MegalodonInterface, maxId?: string): Promise<Array<Entity.Status>> => {