mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
* feat(backend): pin more than one post * add postPinnedCount query, better names for env variable * add store and mixin for pinned posts counts * test pinned post store * context menu for pin posts * fix typos * unpin posts is always possible --------- Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
20 lines
467 B
JavaScript
20 lines
467 B
JavaScript
import { mapGetters, mapActions } from 'vuex'
|
|
|
|
export default {
|
|
computed: {
|
|
...mapGetters({
|
|
maxPinnedPosts: 'pinnedPosts/maxPinnedPosts',
|
|
currentlyPinnedPosts: 'pinnedPosts/currentlyPinnedPosts',
|
|
isAdmin: 'auth/isAdmin',
|
|
}),
|
|
},
|
|
methods: {
|
|
...mapActions({
|
|
fetchPinnedPostsCount: 'pinnedPosts/fetch',
|
|
}),
|
|
},
|
|
async created() {
|
|
if (this.isAdmin && this.maxPinnedPosts === 0) await this.fetchPinnedPostsCount()
|
|
},
|
|
}
|