pleroma-fe/src/components/announcement/announcement.js

30 lines
620 B
JavaScript
Raw Normal View History

2022-03-17 15:07:04 -04:00
import { mapState } from 'vuex'
const Announcement = {
props: {
announcement: Object
},
computed: {
2022-03-17 15:07:04 -04:00
...mapState({
currentUser: state => state.users.currentUser
}),
content () {
return this.announcement.content
2022-03-17 14:01:45 -04:00
},
isRead () {
return this.announcement.read
}
},
methods: {
markAsRead () {
if (!this.isRead) {
return this.$store.dispatch('markAnnouncementAsRead', this.announcement.id)
}
2022-03-17 15:07:04 -04:00
},
deleteAnnouncement () {
return this.$store.dispatch('deleteAnnouncement', this.announcement.id)
}
}
}
export default Announcement