Skip to content

Commit

Permalink
fix(groups): members order sorted alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg authored and stavares843 committed Jun 3, 2022
1 parent 178d5ff commit 7a112c9
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 7a112c9

Please sign in to comment.