Merge pull request #4898 from h3poteto/fix/firefish-filter
Fix filter method for Firefish
This commit is contained in:
commit
b9af54e48e
|
@ -112,21 +112,26 @@ 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>> => {
|
||||||
const res = await client.getFilters()
|
try {
|
||||||
let context = 'home'
|
const res = await client.getFilters()
|
||||||
switch (tl) {
|
let context = 'home'
|
||||||
case 'home':
|
switch (tl) {
|
||||||
context = 'home'
|
case 'home':
|
||||||
break
|
context = 'home'
|
||||||
case 'local':
|
break
|
||||||
case 'public':
|
case 'local':
|
||||||
context = 'public'
|
case 'public':
|
||||||
break
|
context = 'public'
|
||||||
default:
|
break
|
||||||
context = 'home'
|
default:
|
||||||
break
|
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>> => {
|
const loadTimeline = async (tl: string, client: MegalodonInterface, maxId?: string): Promise<Array<Entity.Status>> => {
|
||||||
|
|
Loading…
Reference in New Issue