Skip to content

Commit

Permalink
fix(Routing): add proper routing for circles
Browse files Browse the repository at this point in the history
Signed-off-by: Grigory Vodyanov <[email protected]>
  • Loading branch information
GVodyanov committed Dec 1, 2024
1 parent fdfdaf2 commit da8882a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Vue from 'vue'
import Member from './member'

import { CircleConfigs, MemberLevels } from './constants'
import { CircleConfigs, MemberLevels, ROUTE_CIRCLE } from './constants'

type MemberList = Record<string, Member>

Expand Down Expand Up @@ -303,7 +303,7 @@ export default class Circle {
get router() {
return {
name: 'circle',
params: { selectedCircle: this.id },
params: { selectedCircle: this.id, selectedGroup: ROUTE_CIRCLE },
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/views/Contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export default {
groups() {
return this.$store.getters.getGroups
},
circles() {
return this.$store.getters.getCircles
},
orderKey() {
return this.$store.getters.getOrderKey
},
Expand Down Expand Up @@ -193,6 +196,8 @@ export default {
return this.sortedContacts
} else if (this.selectedGroup === GROUP_NO_GROUP_CONTACTS) {
return this.ungroupedContacts.map(contact => this.sortedContacts.find(item => item.key === contact.key))
} else if (this.selectedGroup === ROUTE_CIRCLE) {
return this.circles
}
const group = this.groups.filter(group => group.name === this.selectedGroup)[0]
if (group) {
Expand Down

0 comments on commit da8882a

Please sign in to comment.