Skip to content

Commit

Permalink
Order sessions by date
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosRodrigo authored and viniciusalbuquerque committed Jun 3, 2019
1 parent b0523c8 commit a3f7476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class ListSessionsViewModel: OnResponse {
return
}

sessionsViewModel = sessions.compactMap {SessionViewModel(session: $0)}
let orderedSessions = sessions.sorted(by: { $0.timestamp._seconds > $1.timestamp._seconds })

sessionsViewModel = orderedSessions.compactMap {SessionViewModel(session: $0)}
self.updateSessions(sessionsViewModel)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct SessionViewModel {
mutating func defineSessionName(count:Int) {
switch count {
case 4:
self.sessionName = "Gain & Pain"
self.sessionName = "Gain & Pleasure"
break
case 5:
self.sessionName = "Starfish"
Expand Down

0 comments on commit a3f7476

Please sign in to comment.