Through fetch filters when sns is misskey

Because Misskye does not have filter
This commit is contained in:
AkiraFukushima 2021-05-24 21:42:07 +09:00
parent 6bde0fc7f9
commit c446a7a2cd
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 8 additions and 4 deletions

View File

@ -186,10 +186,14 @@ const actions: ActionTree<TimelineSpaceState, RootState> = {
* fetchFilters
*/
fetchFilters: async ({ commit, state, rootState }): Promise<Array<Entity.Filter>> => {
const client = generator(state.sns, state.account.baseURL, state.account.accessToken, rootState.App.userAgent)
const res = await client.getFilters()
commit(MUTATION_TYPES.UPDATE_FILTERS, res.data)
return res.data
try {
const client = generator(state.sns, state.account.baseURL, state.account.accessToken, rootState.App.userAgent)
const res = await client.getFilters()
commit(MUTATION_TYPES.UPDATE_FILTERS, res.data)
return res.data
} catch {
return []
}
},
/**
* fetchInstance