diff options
| author | Shpuld Shpuldson <shpuld@shpposter.club> | 2020-01-13 23:34:39 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@shpposter.club> | 2020-01-13 23:34:39 +0200 |
| commit | 33abbed5a1e1d1cf99d21d481b2a22481d7533b2 (patch) | |
| tree | 2f1c335fba4aac6e7d4f3a903a8797df0075d822 /src/components/status/status.js | |
| parent | de945ba3e9470b28dd010fb32f658b42053f19d3 (diff) | |
usable-but-buggy: picker, adding/removing reaction on click, search, styles
Diffstat (limited to 'src/components/status/status.js')
| -rw-r--r-- | src/components/status/status.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 8c6fc0cf..cc0c9e06 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -280,10 +280,7 @@ const Status = { return this.mergedConfig.hidePostStats }, emojiReactions () { - return { - '🤔': [{ 'id': 'xyz..' }, { 'id': 'zyx...' }], - '🐻': [{ 'id': 'abc...' }] - } + return this.status.emojiReactions }, ...mapGetters(['mergedConfig']) }, @@ -385,6 +382,22 @@ const Status = { setMedia () { const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments return () => this.$store.dispatch('setMedia', attachments) + }, + reactedWith (emoji) { + return this.status.reactedWithEmoji.includes(emoji) + }, + reactWith (emoji) { + this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji }) + }, + unreact (emoji) { + this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji }) + }, + emojiOnClick (emoji, event) { + if (this.reactedWith(emoji)) { + this.unreact(emoji) + } else { + this.reactWith(emoji) + } } }, watch: { |
