aboutsummaryrefslogtreecommitdiff
path: root/src/components/react_button
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2020-02-11 23:09:15 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2020-02-11 23:09:15 +0000
commit84ebae8ed36390f62ccda653d4fb9d8aad1482a2 (patch)
tree70fb486e4b31b029c8dbcb89f87acf154275f905 /src/components/react_button
parent60446c56a5c8d4b4d669fbd4803e77ce686daac9 (diff)
parent96dc297babd5797b9307af8676719c2eb8cd80e2 (diff)
Merge branch 'develop' into 'themes-accent'
# Conflicts: # src/components/emoji_reactions/emoji_reactions.vue
Diffstat (limited to 'src/components/react_button')
-rw-r--r--src/components/react_button/react_button.js7
-rw-r--r--src/components/react_button/react_button.vue4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/components/react_button/react_button.js b/src/components/react_button/react_button.js
index 6fb2a780..a6cf5b94 100644
--- a/src/components/react_button/react_button.js
+++ b/src/components/react_button/react_button.js
@@ -22,7 +22,12 @@ const ReactButton = {
this.showTooltip = false
},
addReaction (event, emoji) {
- this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
+ const existingReaction = this.status.emoji_reactions.find(r => r.name === emoji)
+ if (existingReaction && existingReaction.me) {
+ this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
+ } else {
+ this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
+ }
this.closeReactionSelect()
}
},
diff --git a/src/components/react_button/react_button.vue b/src/components/react_button/react_button.vue
index c925dd71..fb43ebaf 100644
--- a/src/components/react_button/react_button.vue
+++ b/src/components/react_button/react_button.vue
@@ -54,6 +54,10 @@
.reaction-picker-filter {
padding: 0.5em;
+ display: flex;
+ input {
+ flex: 1;
+ }
}
.reaction-picker-divider {