Fix filter method for Firefish

This commit is contained in:
AkiraFukushima 2024-03-15 21:21:04 +09:00
parent d3dfa2e5a4
commit c10e410573
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 19 additions and 14 deletions

View File

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