Skip to content

Commit

Permalink
Use consistent room order in linear timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Jul 17, 2024
1 parent 7e049e1 commit c63f4da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
@unfav="unfav($event)")
linear-schedule(v-else,
:sessions="sessions",
:rooms="rooms",
:currentDay="currentDay",
:now="now",
:scrollParent="scrollParent",
Expand Down
6 changes: 5 additions & 1 deletion src/components/LinearSchedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
components: { Session },
props: {
sessions: Array,
rooms: Array,
favs: {
type: Array,
default () {
Expand Down Expand Up @@ -57,7 +58,10 @@ export default {
buckets[key].push(session)
}
}
return Object.entries(buckets).map(([date, sessions]) => ({date: sessions[0].start, sessions}))
return Object.entries(buckets).map(([date, sessions]) => ({
date: sessions[0].start,
// sort by room for stable sort across time buckets
sessions: sessions.sort((a, b) => this.rooms.findIndex(room => room.id === a.room.id) - this.rooms.findIndex(room => room.id === b.room.id))}))
}
},
watch: {
Expand Down

0 comments on commit c63f4da

Please sign in to comment.