Skip to content

Commit

Permalink
fix: fixes a particular case where the tracking board doesn't load af…
Browse files Browse the repository at this point in the history
…ter initial onboarding (#48)
  • Loading branch information
donalmacanri authored Feb 11, 2023
1 parent 47f26aa commit aab2057
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/domains/board/UniboardStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ export const initUniboardStore = async (knownTrackables: ITrackables) => {
// TODO: Handle Sorting
UniboardStore.update((s) => {
s.boards = boards
s.activeId = s.activeId || boards.length ? boards[0].id : undefined
s.hash = objectHash(boards)

s.dynamicBoards.people = {
Expand All @@ -244,8 +243,13 @@ export const initUniboardStore = async (knownTrackables: ITrackables) => {
elements: trackables.filter((t) => t.type === 'tracker').map((t) => t.tag),
}

if (s.boards.find((b) => b.id == getLastBoardId())) {
s.activeId = getLastBoardId()
} else {
s.activeId = boards.length ? boards[0].id : undefined
}
s.loaded = true
s.activeId = getLastBoardId()

return s
})
}
Expand Down

0 comments on commit aab2057

Please sign in to comment.