Page MenuHomePhorge

react_button.js
No OneTemporary

Size
1007 B
Referenced Files
None
Subscribers
None

react_button.js

import Popover from '../popover/popover.vue'
import { mapGetters } from 'vuex'
const ReactButton = {
props: ['status'],
data () {
return {
filterWord: ''
}
},
components: {
Popover
},
methods: {
addReaction (event, emoji, close) {
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 })
}
close()
}
},
computed: {
commonEmojis () {
return ['👍', '😠', '👀', '😂', '🔥']
},
emojis () {
if (this.filterWord !== '') {
return this.$store.state.instance.emoji.filter(emoji => emoji.displayText.includes(this.filterWord))
}
return this.$store.state.instance.emoji || []
},
...mapGetters(['mergedConfig'])
}
}
export default ReactButton

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 3, 5:03 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
439099
Default Alt Text
react_button.js (1007 B)

Event Timeline