Skip to content

Commit

Permalink
fix(groups): members order sorted alpha (#3460)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg authored Jun 6, 2022
1 parent 543f0eb commit 9a1c3cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/views/navigation/toolbar/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default Vue.extend({
},
ModalWindows: () => ModalWindows,
src(): string {
const hash = this.recipient?.profilePicture
const hash = (this.recipient as Friend).profilePicture
return hash ? `${this.$Config.textile.browser}/ipfs/${hash}` : ''
},
isGroup(): boolean {
Expand Down
4 changes: 0 additions & 4 deletions layouts/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ export default Vue.extend({
},
},
watch: {
recipient: {
handler() {},
immediate: true,
},
showSidebar(newValue, oldValue) {
if (newValue !== oldValue) {
newValue
Expand Down
7 changes: 4 additions & 3 deletions store/groups/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ const mutations = {
state: GroupsState,
{ groupId, members }: { groupId: string; members: GroupMember[] },
) {
state.all = state.all.map((group) =>
group.id === groupId ? { ...group, members } : group,
)
const group = state.all.find((g) => g.id === groupId)
if (group) {
group.members = members.sort((a, b) => a.name.localeCompare(b.name))
}
},
setGroupsLastUpdate(state: GroupsState, payload: { [key: string]: number }) {
state.all = state.all.map((group) => ({
Expand Down

0 comments on commit 9a1c3cf

Please sign in to comment.