logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

status_bookmark_folder_menu.js (1083B)


  1. import { library } from '@fortawesome/fontawesome-svg-core'
  2. import { faChevronRight, faFolder } from '@fortawesome/free-solid-svg-icons'
  3. import { mapState } from 'pinia'
  4. import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
  5. import Popover from 'src/components/popover/popover.vue'
  6. import StillImage from 'src/components/still-image/still-image.vue'
  7. library.add(faChevronRight, faFolder)
  8. const StatusBookmarkFolderMenu = {
  9. props: [
  10. 'status',
  11. 'close'
  12. ],
  13. data () {
  14. return {}
  15. },
  16. components: {
  17. Popover,
  18. StillImage
  19. },
  20. computed: {
  21. ...mapState(useBookmarkFoldersStore, {
  22. folders: store => store.allFolders
  23. }),
  24. folderId () {
  25. return this.status.bookmark_folder_id
  26. }
  27. },
  28. methods: {
  29. toggleFolder (id) {
  30. const value = id === this.folderId ? null : id
  31. this.$store.dispatch('bookmark', { id: this.status.id, bookmark_folder_id: value })
  32. .then(() => this.$emit('onSuccess'))
  33. .catch(err => this.$emit('onError', err.error.error))
  34. }
  35. }
  36. }
  37. export default StatusBookmarkFolderMenu