Skip to content

Commit

Permalink
Minor updates to BDR download #3169
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Dec 20, 2024
1 parent bc2236c commit 62960fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions grails-app/assets/javascripts/dataSets.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var DataSetsViewModel =function(dataSets, projectService, config) {

function isDownloadableMonitorDataSet(dataSet) {

if (dataSet.createdIn !== MONITOR_APP) {
if (dataSet.collectionApp !== MONITOR_APP) {
return false;
}
var protocolId = dataSet.protocol;
Expand All @@ -52,7 +52,7 @@ var DataSetsViewModel =function(dataSets, projectService, config) {
if (isDownloadable) {
var now = moment();
var creationDate = moment(dataSet.dateCreated);
var minutesToInjestDataSet = options.minutesToInjestDataSet || 1;
var minutesToInjestDataSet = config.minutesToInjestDataSet || 1;
if (dataSet.progress !== ActivityProgress.planned) {
if (creationDate.add(minutesToInjestDataSet, 'minutes').isBefore(now)) {
isDownloadable = true;
Expand Down Expand Up @@ -98,6 +98,9 @@ var DataSetsViewModel =function(dataSets, projectService, config) {

if (this.createdIn === MONITOR_APP) {
if (this.progress == ActivityProgress.planned) {
var now = moment();
var creationDate = moment(dataSet.dateCreated);

if (creationDate.add(1, 'minutes').isBefore(now)) {
this.progress = 'sync error';
}
Expand Down

0 comments on commit 62960fa

Please sign in to comment.