Skip to content

Commit

Permalink
refactor: 펫이 30마리 일때 visible이 변경되지 않는 버그를 수정한다
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed May 17, 2024
1 parent d217529 commit 790b3a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/org/gitanimals/render/domain/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ class User(
val persona = personas.find { it.id == personaId }
?: throw IllegalArgumentException("Cannot find persona by id \"$personaId\"")

persona.visible = visible

val visiblePersonas = personas.filter { it.visible }

require(visiblePersonas.size < MAX_PERSONA_COUNT) {
"Persona count must be under \"$MAX_PERSONA_COUNT\" but, current persona count is \"${visiblePersonas.size}\""
}

persona.visible = visible
return persona
}

Expand Down

0 comments on commit 790b3a1

Please sign in to comment.