Skip to content

Commit

Permalink
Update DataPackage.js
Browse files Browse the repository at this point in the history
For loading spinner for package with a single object
  • Loading branch information
rushirajnenuji committed Jan 29, 2024
1 parent 51ee1c9 commit 24dc998
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/collections/DataPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ define(['jquery', 'underscore', 'backbone', 'rdflib', "uuid", "md5",
console.log(error);
}

// trigger complete if fetchModel is false and this is the only object in the package
if (this.fetchModels == false && models.length == 1)
this.triggerComplete();

return models;
},

Expand Down Expand Up @@ -1757,8 +1761,6 @@ define(['jquery', 'underscore', 'backbone', 'rdflib', "uuid", "md5",

//If there are any models that are not synced yet, the collection is not complete
if( notSynced.length > 0 ) {
var view = this;
this.listenToOnce(notSynced[0], "sync", this.triggerComplete, notSynced[0]);
return;
}

Expand Down

0 comments on commit 24dc998

Please sign in to comment.