Skip to content

Commit

Permalink
join, part: sort lists by date asc
Browse files Browse the repository at this point in the history
Fixes #1501
PR #1502
  • Loading branch information
sogehige committed Nov 6, 2018
1 parent 1b035e6 commit b0a30ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/panel/widgets/components/join.vue
Expand Up @@ -47,7 +47,7 @@ export default {
},
computed: {
joined: function () {
const list = _(this.list.filter(o => o.type === 'join').sort(o => new Date(o.createdAt).getTime())).chunk(30).value()[0]
let list = _(this.list.filter(o => o.type === 'join').sort(o => -(new Date(o.createdAt).getTime()))).chunk(30).value()[0]
return list ? list.map(o => o.username).join(', ') : ''
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/panel/widgets/components/part.vue
Expand Up @@ -47,7 +47,7 @@ export default {
},
computed: {
parted: function () {
const list = _(this.list.filter(o => o.type === 'part').sort(o => new Date(o.createdAt).getTime())).chunk(30).value()[0]
let list = _(this.list.filter(o => o.type === 'part').sort(o => -(new Date(o.createdAt).getTime()))).chunk(30).value()[0]
return list ? list.map(o => o.username).join(', ') : ''
}
},
Expand Down

0 comments on commit b0a30ab

Please sign in to comment.