Skip to content

Commit

Permalink
fix(userpicker): types
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwoodland authored and stavares843 committed Jun 9, 2022
1 parent 7c16cf7 commit 36f1d35
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/interactables/UserPicker/UserPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import Vue from 'vue'
import { mapState } from 'vuex'
import { Friend } from '~/types/ui/friends'
import { RootState } from '~/types/store/store'
export default Vue.extend({
name: 'UserPicker',
Expand All @@ -12,20 +13,21 @@ export default Vue.extend({
filter: '',
}),
computed: {
...mapState(['friends']),
filteredFriends() {
...mapState({
friends: (state) => (state as RootState).friends.all,
}),
filteredFriends(): Friend[] {
if (this.filter) {
const filterLower = this.filter.toLowerCase()
return this.friends.all.filter((friend: Friend) => {
return this.friends.filter((friend: Friend) => {
return friend.name.toLowerCase().includes(filterLower)
})
}
return this.friends.all
return this.friends
},
},
watch: {
selected() {
console.log('emit', this.selected)
this.$emit('input', this.selected)
},
},
Expand Down

0 comments on commit 36f1d35

Please sign in to comment.