Skip to content

Commit

Permalink
fix(logbook): Tasks not showing when has tasks of just one type "rout…
Browse files Browse the repository at this point in the history
…ine" or "study"
  • Loading branch information
OdisBy authored and leoallvez committed Aug 9, 2024
1 parent d95e238 commit 2dcda7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ data class LogbookTaskRemote(

data class Data(
val count: Int,
val routine: List<LogbookRemoteItem>,
val study: List<LogbookRemoteItem>
val routine: List<LogbookRemoteItem>?,
val study: List<LogbookRemoteItem>?,
)

data class LogbookRemoteItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun LogbookTaskRemote.toLogbookTask(): List<LogbookTask> {
val idToCard = TaskItem.getAllTaskItems().associateBy { it.taskId }
val logbookItems = mutableListOf<LogbookTask>()

this.data.routine.map { remote ->
this.data.routine?.map { remote ->
logbookItems.add(
LogbookTask(
itemOfCategory = idToCard[remote.categoryId]!!,
Expand All @@ -40,7 +40,7 @@ fun LogbookTaskRemote.toLogbookTask(): List<LogbookTask> {
)
)
}
this.data.study.map { remote ->
this.data.study?.map { remote ->
logbookItems.add(
LogbookTask(
itemOfCategory = idToCard[remote.categoryId]!!,
Expand Down

0 comments on commit 2dcda7a

Please sign in to comment.