feat: SW-276 Optimized code
This commit is contained in:
@@ -23,19 +23,17 @@ export default function ChildSelector({
|
||||
const childrenLabel = intl.formatMessage({ id: "Children" })
|
||||
|
||||
function decreaseChildren() {
|
||||
if (roomChildren.length < 1) {
|
||||
return
|
||||
if (roomChildren.length > 0) {
|
||||
roomChildren.pop()
|
||||
updateChildren(roomChildren)
|
||||
}
|
||||
roomChildren.pop()
|
||||
updateChildren(roomChildren)
|
||||
}
|
||||
|
||||
function increaseChildren() {
|
||||
if (roomChildren.length > 5) {
|
||||
return
|
||||
if (roomChildren.length < 5) {
|
||||
roomChildren.push({ age: -1, bed: -1 })
|
||||
updateChildren(roomChildren)
|
||||
}
|
||||
roomChildren.push({ age: -1, bed: -1 })
|
||||
updateChildren(roomChildren)
|
||||
}
|
||||
|
||||
function updateChildInfo(child: Child, index: number) {
|
||||
|
||||
Reference in New Issue
Block a user