import { panelStatus } from '@/utils/common'
const getters = {
    chatlist (state) {
      return state.user.chatlist
    },
    searchChatlist (state) {
      return state.user.searchChatlist
    },
    // searchedFriendlist (state) {
    //   let friends = state.user.friendlist.filter(friends => friends.remark.includes(state.user.searchText));
    //   return friends
    // },
    selectedChat (state) {
      let temp = state.user.chatlist.find(session => session.id === state.user.selectId);
      return temp
    },
    selectedSearchChat(state){
      let temp = state.user.searchChatlist.find(session => session.id === state.user.selectId);
      return temp
    },
    selectedFriend (state) {
      let friend = state.user.friendlist.find(friend => friend.id === state.user.selectFriendId);
      return friend
    },
    messages (state) {
      let session = state.user.chatlist.find(session => session.id === state.user.selectId);
      return session&&session.messages
    }
}
export default getters