消息监听整理完善

This commit is contained in:
2022-02-17 14:21:53 +08:00
parent c4704cb5ae
commit b4e4ee5458
6 changed files with 156 additions and 151 deletions

View File

@@ -9,9 +9,10 @@ export default {
contacts(state) {
return state.contacts
},
contactInfo: (state) => (targetId) => {
contactInfo: (state) => (targetId) => {
if (state.contacts[targetId]) {
const info = state.contacts[targetId]
return {
name: info.name,
hash: info.hash,
@@ -37,7 +38,7 @@ export default {
updateContactInfo(state, contactInfo) {
Vue.set(state.contacts, contactInfo.targetId, contactInfo)
},
setSenderInfo(state, contactInfo) {
setSenderInfo(state, contactInfo) {
state.myInfo = {
userId: contactInfo.targetId,
name: contactInfo.name,
@@ -49,7 +50,7 @@ export default {
setSenderInfo({
commit
}, contactInfo) {
commit('setSenderInfo', contactInfo)
commit('setSenderInfo', contactInfo)
},
// 载入好友信息
launchContact({