Merge pull request 'extra section length' (#53) from bx-1146-more_calc into dev
Deploy / build_and_push_images (push) Successful in 1m32s Details
Deploy / deploy_to_server_dev (push) Successful in 38s Details

Reviewed-on: #53
This commit is contained in:
ksenia_mikhailova 2024-07-26 09:08:53 +03:00
commit f8a6cb4096
1 changed files with 4 additions and 1 deletions

View File

@ -101,10 +101,13 @@ const changeParametres = () => {
if (full_sections == 0) {
length = total_length_mm - fence_length - fence_length
}
if ((total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length)) < fence_length) {
full_sections -= 1
}
}
if (((full_sections * length) + (full_sections * fence_length) + fence_length) < total_length_mm) {
form_state.extra_section = total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length + fence_length)
form_state.extra_section = total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length) - fence_length
} else {
form_state.extra_section = 0
}