Skip to content

Commit

Permalink
fix: allow pools to not be defined without breaking all javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHulme committed Oct 17, 2024
1 parent f1b6287 commit d8b7b29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/frontend/javascript/legacy_scripts_a.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ let limberPlateView = function (defaultTab) {
control.find('a[href="' + defaultTab + '"]').tab('show')

plateElement.on('click', '.aliquot', function (event) {
control.find('a[data-plate-view="pools-view"]').tab('show')

Check warning on line 63 in app/frontend/javascript/legacy_scripts_a.js

View check run for this annotation

Codecov / codecov/patch

app/frontend/javascript/legacy_scripts_a.js#L62-L63

Added lines #L62 - L63 were not covered by tests
let pool = $(event.currentTarget).data('pool')

control.find('a[data-plate-view="pools-view"]').tab('show')
// Handle cases where pool is not defined to prevent errors
if (pool === undefined || pool === '') return

Check warning on line 67 in app/frontend/javascript/legacy_scripts_a.js

View check run for this annotation

Codecov / codecov/patch

app/frontend/javascript/legacy_scripts_a.js#L66-L67

Added lines #L66 - L67 were not covered by tests

plateElement
.find('.aliquot[data-pool!=' + pool + ']')
Expand Down

0 comments on commit d8b7b29

Please sign in to comment.