logo

pleroma-fe

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

chat_list.js (744B)


  1. import { mapState, mapGetters } from 'vuex'
  2. import ChatListItem from '../chat_list_item/chat_list_item.vue'
  3. import ChatNew from '../chat_new/chat_new.vue'
  4. import List from '../list/list.vue'
  5. const ChatList = {
  6. components: {
  7. ChatListItem,
  8. List,
  9. ChatNew
  10. },
  11. computed: {
  12. ...mapState({
  13. currentUser: state => state.users.currentUser
  14. }),
  15. ...mapGetters(['sortedChatList'])
  16. },
  17. data () {
  18. return {
  19. isNew: false
  20. }
  21. },
  22. created () {
  23. this.$store.dispatch('fetchChats', { latest: true })
  24. },
  25. methods: {
  26. cancelNewChat () {
  27. this.isNew = false
  28. this.$store.dispatch('fetchChats', { latest: true })
  29. },
  30. newChat () {
  31. this.isNew = true
  32. }
  33. }
  34. }
  35. export default ChatList