From d639cdbeeb2124377e6eb69afbeaf657642fbdf4 Mon Sep 17 00:00:00 2001 From: silver-it Date: Wed, 28 Feb 2024 07:32:17 +0800 Subject: [PATCH] chore: follow-up process for changes of getters --- frontend/model/state.js | 8 ++++---- frontend/views/containers/chatroom/ChatMembers.vue | 1 - frontend/views/containers/chatroom/DMMixin.js | 2 -- frontend/views/containers/chatroom/LeaveChannelModal.vue | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/model/state.js b/frontend/model/state.js index 474c845530..8cc22c0aa6 100644 --- a/frontend/model/state.js +++ b/frontend/model/state.js @@ -493,11 +493,11 @@ const getters = { return nameA.normalize().toUpperCase() > nameB.normalize().toUpperCase() ? 1 : -1 }) }, - ourContacts (state, getters) { - return Object.keys(getters.ourContactProfiles) + ourContactsByUsername (state, getters) { + return Object.keys(getters.ourContactProfilesByUsername) .sort((usernameA, usernameB) => { - const nameA = getters.ourContactProfiles[usernameA].displayName || usernameA - const nameB = getters.ourContactProfiles[usernameB].displayName || usernameB + const nameA = getters.ourContactProfilesByUsername[usernameA].displayName || usernameA + const nameB = getters.ourContactProfilesByUsername[usernameB].displayName || usernameB return nameA.normalize().toUpperCase() > nameB.normalize().toUpperCase() ? 1 : -1 }) } diff --git a/frontend/views/containers/chatroom/ChatMembers.vue b/frontend/views/containers/chatroom/ChatMembers.vue index bcec5adaa6..6a811b6a51 100644 --- a/frontend/views/containers/chatroom/ChatMembers.vue +++ b/frontend/views/containers/chatroom/ChatMembers.vue @@ -68,7 +68,6 @@ export default ({ }, computed: { ...mapGetters([ - 'ourContactProfiles', 'groupShouldPropose', 'ourGroupDirectMessages', 'chatRoomUnreadMentions', diff --git a/frontend/views/containers/chatroom/DMMixin.js b/frontend/views/containers/chatroom/DMMixin.js index 0d4ad4eeb8..137618dda7 100644 --- a/frontend/views/containers/chatroom/DMMixin.js +++ b/frontend/views/containers/chatroom/DMMixin.js @@ -6,8 +6,6 @@ const DMMixin: Object = { computed: { ...mapGetters([ 'currentChatRoomId', - 'ourContacts', - 'ourContactProfiles', 'isDirectMessage', 'ourGroupDirectMessages', 'ourIdentityContractId', diff --git a/frontend/views/containers/chatroom/LeaveChannelModal.vue b/frontend/views/containers/chatroom/LeaveChannelModal.vue index 470a965564..9771eb96b9 100644 --- a/frontend/views/containers/chatroom/LeaveChannelModal.vue +++ b/frontend/views/containers/chatroom/LeaveChannelModal.vue @@ -38,8 +38,7 @@ export default ({ 'currentChatRoomId', 'currentChatRoomState', 'ourGroupDirectMessages', - 'isDirectMessage', - 'ourContactProfiles' + 'isDirectMessage' ]), ...mapState(['loggedIn', 'currentGroupId']), channelName () {