Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/stores/contacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import apis from '@/services/apis'
import { useGlobalStore } from '@/stores/global'
import type { ContactItem, RequestFriendItem } from '@/services/types'
import { RequestFriendAgreeStatus } from '@/services/types'
import { useChatStore } from './chat'

export const pageSize = 20
export const useContactStore = defineStore('contact', () => {
const chatStore = useChatStore()
const globalStore = useGlobalStore()
const contactsList = reactive<ContactItem[]>([])
const requestFriendsList = reactive<RequestFriendItem[]>([])
Expand Down Expand Up @@ -103,6 +105,11 @@ export const useContactStore = defineStore('contact', () => {
// getRequestFriendsList(true)
// 刷新好友列表
getContactList(true)
// 更新会话列表
chatStore.removeContact(data.roomId)
// 切换为第一个会话
globalStore.currentSession.roomId = chatStore.sessionList[0].roomId
globalStore.currentSession.type = chatStore.sessionList[0].type
}
return {
getContactList,
Expand Down