updated Provider.load to respect sources hierarchy
This commit is contained in:
parent
6b6bf85802
commit
a216336290
1 changed files with 5 additions and 2 deletions
|
@ -343,17 +343,20 @@ Provider.prototype.load = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadSources () {
|
function loadSources () {
|
||||||
|
var sourceHierarchy = self.sources.splice(0);
|
||||||
|
sourceHierarchy.reverse();
|
||||||
|
|
||||||
//
|
//
|
||||||
// If we don't have a callback and the current
|
// If we don't have a callback and the current
|
||||||
// store is capable of loading synchronously
|
// store is capable of loading synchronously
|
||||||
// then do so.
|
// then do so.
|
||||||
//
|
//
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
mergeSources(loadBatch(self.sources));
|
mergeSources(loadBatch(sourceHierarchy));
|
||||||
return loadBatch(getStores());
|
return loadBatch(getStores());
|
||||||
}
|
}
|
||||||
|
|
||||||
loadBatch(self.sources, function (err, data) {
|
loadBatch(sourceHierarchy, function (err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue