[eslint] refs #850 Fix indent spaces for NewToot
This commit is contained in:
parent
b9941e71c3
commit
21605412cf
|
@ -111,10 +111,11 @@ const actions: ActionTree<NewTootState, RootState> = {
|
||||||
rootState.TimelineSpace.account.accessToken,
|
rootState.TimelineSpace.account.accessToken,
|
||||||
rootState.TimelineSpace.account.baseURL + '/api/v1'
|
rootState.TimelineSpace.account.baseURL + '/api/v1'
|
||||||
)
|
)
|
||||||
return Promise.all(
|
const attachments = Object.keys(media).map(async id => {
|
||||||
Object.keys(media).map(async id => {
|
return client.put<Attachment>(`/media/${id}`, { description: media[id] })
|
||||||
return client.put<Attachment>(`/media/${id}`, { description: media[id] })
|
})
|
||||||
})).catch(err => {
|
return Promise.all(attachments)
|
||||||
|
.catch(err => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
throw err
|
throw err
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,23 +30,19 @@ export const MUTATION_TYPES = {
|
||||||
|
|
||||||
const mutations: MutationTree<StatusState> = {
|
const mutations: MutationTree<StatusState> = {
|
||||||
[MUTATION_TYPES.UPDATE_FILTERED_ACCOUNTS]: (state, accounts: Array<Account>) => {
|
[MUTATION_TYPES.UPDATE_FILTERED_ACCOUNTS]: (state, accounts: Array<Account>) => {
|
||||||
state.filteredAccounts = accounts.map((a) => {
|
state.filteredAccounts = accounts.map(a => ({
|
||||||
return {
|
name: `@${a.acct}`,
|
||||||
name: `@${a.acct}`,
|
image: null
|
||||||
image: null
|
}))
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
[MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS]: (state) => {
|
[MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS]: (state) => {
|
||||||
state.filteredAccounts = []
|
state.filteredAccounts = []
|
||||||
},
|
},
|
||||||
[MUTATION_TYPES.UPDATE_FILTERED_HASHTAGS]: (state, tags: Array<Tag>) => {
|
[MUTATION_TYPES.UPDATE_FILTERED_HASHTAGS]: (state, tags: Array<Tag>) => {
|
||||||
state.filteredHashtags = tags.map((t) => {
|
state.filteredHashtags = tags.map(t => ({
|
||||||
return {
|
name: `#${t}`,
|
||||||
name: `#${t}`,
|
image: null
|
||||||
image: null
|
}))
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
[MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS]: (state) => {
|
[MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS]: (state) => {
|
||||||
state.filteredHashtags = []
|
state.filteredHashtags = []
|
||||||
|
@ -70,7 +66,7 @@ const actions: ActionTree<StatusState, RootState> = {
|
||||||
rootState.TimelineSpace.account.baseURL + '/api/v1'
|
rootState.TimelineSpace.account.baseURL + '/api/v1'
|
||||||
)
|
)
|
||||||
const res: Response<Results> = await client.get<Results>('/search', { q: word })
|
const res: Response<Results> = await client.get<Results>('/search', { q: word })
|
||||||
commit(MUTATION_TYPES.UPDATE_FILTERED_HASHTAGS, res.data.hashtags)
|
commit(MUTATION_TYPES.UPDATE_FILTERED_HASHTAGS, res.data.hashtags)
|
||||||
if (res.data.hashtags.length === 0) throw new Error('Empty')
|
if (res.data.hashtags.length === 0) throw new Error('Empty')
|
||||||
return res.data.hashtags
|
return res.data.hashtags
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue