Skip to content

Commit

Permalink
Some more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emrojo committed Jan 20, 2021
1 parent 4952c34 commit e7551a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/javascript/plain-javascript/page-reloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ document.addEventListener('DOMContentLoaded', () => {
console.log('Loaded')
const timerElement = document.querySelector('[data-reload-time]')
if (timerElement) {
let timer = parseInt(timerElement.dataset['reloadTime'])
let timer = parseInt(timerElement.dataset['reloadTime'], 10)
let interval = window.setInterval(_ => {
timer -= 1 // Decrement timer
timerElement.textContent = timer // Update the onscreen counter
if (timer <= 0) { // If we've hit zero
window.clearInterval(interval) // Stop the interval
location.reload() // And reload the page
}
},1000)
}, 1000)
}
})
10 changes: 7 additions & 3 deletions app/models/sequencescape_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ def assets
@asset_groups.pluck(:assets)
end

def extra_barcodes_list
return nil unless extra_barcodes
extra_barcodes.split(' ')
end

def extra_plates
return @extra_plates if @extra_plates

response = Sequencescape::Api::V2.additional_plates_for_presenter(barcode: extra_barcodes)
response = Sequencescape::Api::V2.additional_plates_for_presenter(barcode: extra_barcodes_list)
@extra_plates ||= response
raise "Barcodes not found #{extra_barcodes}" unless @extra_plates

Expand All @@ -82,7 +86,7 @@ def extra_assets

@extra_assets ||= extra_plates.map do |labware|
labware.wells.reject(&:empty?).map(&:uuid)
end.flatten
end.flatten.uniq
end

#
Expand Down

0 comments on commit e7551a0

Please sign in to comment.