Merge pull request #4898 from h3poteto/fix/firefish-filter
Fix filter method for Firefish
This commit is contained in:
commit
b9af54e48e
|
@ -112,6 +112,7 @@ export default function Timeline(props: Props) {
|
||||||
}, [props.timeline, props.client, props.account])
|
}, [props.timeline, props.client, props.account])
|
||||||
|
|
||||||
const loadFilter = async (tl: string, client: MegalodonInterface): Promise<Array<Entity.Filter>> => {
|
const loadFilter = async (tl: string, client: MegalodonInterface): Promise<Array<Entity.Filter>> => {
|
||||||
|
try {
|
||||||
const res = await client.getFilters()
|
const res = await client.getFilters()
|
||||||
let context = 'home'
|
let context = 'home'
|
||||||
switch (tl) {
|
switch (tl) {
|
||||||
|
@ -127,6 +128,10 @@ export default function Timeline(props: Props) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return res.data.filter(f => f.context.includes(context))
|
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>> => {
|
const loadTimeline = async (tl: string, client: MegalodonInterface, maxId?: string): Promise<Array<Entity.Status>> => {
|
||||||
|
|
Loading…
Reference in New Issue