refs #1281 Send emoji reactions to the statuses
This commit is contained in:
parent
f5dfd2474a
commit
7d36f96396
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue