refs #1281 Send emoji reactions to the statuses

This commit is contained in:
AkiraFukushima 2020-04-22 22:38:11 +09:00
parent f5dfd2474a
commit 7d36f96396
2 changed files with 22 additions and 2 deletions

View File

@ -610,8 +610,12 @@ export default {
hideEmojiPicker() {
this.openEmojiPicker = false
},
selectEmoji(emoji) {
console.log(emoji)
async selectEmoji(emoji) {
await this.$store.dispatch('organisms/Toot/sendReaction', {
status_id: this.originalMessage.id,
native: emoji.native
})
this.hideEmojiPicker()
}
}
}

View File

@ -10,6 +10,11 @@ type VoteParam = {
choices: Array<number>
}
type ReactionParam = {
status_id: string
native: string
}
export type TootState = {}
const state = (): TootState => ({})
@ -110,6 +115,17 @@ const actions: ActionTree<TootState, RootState> = {
)
const res = await client.getPoll(id)
return res.data
},
sendReaction: async ({ rootState }, params: ReactionParam): Promise<Entity.Status> => {
const client = generator(
rootState.TimelineSpace.sns,
rootState.TimelineSpace.account.baseURL,
rootState.TimelineSpace.account.accessToken,
rootState.App.userAgent,
rootState.App.proxyConfiguration
)
const res = await client.createEmojiReaction(params.status_id, params.native)
return res.data
}
}