Skip to content

Commit

Permalink
fix: 一部のバージョンのMisskeyでうまく動作しなくなる問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
pantasystem committed Nov 6, 2023
1 parent 3223c57 commit 6c13fde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@ data class UserDTO(
val iconUrl: String?,

@SerialName("displayOrder")
val displayOrder: Int,
val displayOrder: Int? = null,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ class UserDTOEntityConverter @Inject constructor(
it.name to it.host to it.url to it.uri
}

val badgeRoles = userDTO.badgeRoles?.map { role ->
val badgeRoles = userDTO.badgeRoles?.mapIndexed { index, role ->
User.BadgeRole(
name = role.name,
iconUri = role.iconUrl,
displayOrder = role.displayOrder
displayOrder = role.displayOrder ?: ((userDTO.badgeRoles?.size ?: 0) - index)
)
}?.sortedByDescending {
it.displayOrder
Expand Down

0 comments on commit 6c13fde

Please sign in to comment.