[eslint] refs #850 Fix indent spaces for NewToot

This commit is contained in:
AkiraFukushima 2019-04-11 00:24:34 +09:00
parent b9941e71c3
commit 21605412cf
2 changed files with 14 additions and 17 deletions

View File

@ -111,10 +111,11 @@ const actions: ActionTree<NewTootState, RootState> = {
rootState.TimelineSpace.account.accessToken,
rootState.TimelineSpace.account.baseURL + '/api/v1'
)
return Promise.all(
Object.keys(media).map(async id => {
return client.put<Attachment>(`/media/${id}`, { description: media[id] })
})).catch(err => {
const attachments = Object.keys(media).map(async id => {
return client.put<Attachment>(`/media/${id}`, { description: media[id] })
})
return Promise.all(attachments)
.catch(err => {
console.error(err)
throw err
})

View File

@ -30,23 +30,19 @@ export const MUTATION_TYPES = {
const mutations: MutationTree<StatusState> = {
[MUTATION_TYPES.UPDATE_FILTERED_ACCOUNTS]: (state, accounts: Array<Account>) => {
state.filteredAccounts = accounts.map((a) => {
return {
name: `@${a.acct}`,
image: null
}
})
state.filteredAccounts = accounts.map(a => ({
name: `@${a.acct}`,
image: null
}))
},
[MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS]: (state) => {
state.filteredAccounts = []
},
[MUTATION_TYPES.UPDATE_FILTERED_HASHTAGS]: (state, tags: Array<Tag>) => {
state.filteredHashtags = tags.map((t) => {
return {
name: `#${t}`,
image: null
}
})
state.filteredHashtags = tags.map(t => ({
name: `#${t}`,
image: null
}))
},
[MUTATION_TYPES.CLEAR_FILTERED_ACCOUNTS]: (state) => {
state.filteredHashtags = []
@ -70,7 +66,7 @@ const actions: ActionTree<StatusState, RootState> = {
rootState.TimelineSpace.account.baseURL + '/api/v1'
)
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')
return res.data.hashtags
}