@checksub_team/peaks_timeline 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/peaks.js +10 -7
- package/src/components/data-retriever.js +13 -8
package/package.json
CHANGED
package/peaks.js
CHANGED
|
@@ -14561,7 +14561,7 @@ module.exports = function (Utils, Konva) {
|
|
|
14561
14561
|
return Axis;
|
|
14562
14562
|
}(_dereq_('../utils'), _dereq_('konva'));
|
|
14563
14563
|
},{"../utils":116,"konva":43}],87:[function(_dereq_,module,exports){
|
|
14564
|
-
module.exports = function (Data) {
|
|
14564
|
+
module.exports = function (Data, Utils) {
|
|
14565
14565
|
'use strict';
|
|
14566
14566
|
function DataRetriever(peaks) {
|
|
14567
14567
|
this._peaks = peaks;
|
|
@@ -14607,11 +14607,10 @@ module.exports = function (Data) {
|
|
|
14607
14607
|
throw new Error('HTTP ' + response.status + ': ' + response.statusText);
|
|
14608
14608
|
}
|
|
14609
14609
|
return response.blob();
|
|
14610
|
-
}).catch(function (err) {
|
|
14611
|
-
return later(delay).then(function () {
|
|
14612
|
-
return recur(timesTried + 1, err);
|
|
14613
|
-
});
|
|
14614
14610
|
}).then(function (blob) {
|
|
14611
|
+
if (Utils.isNullOrUndefined(blob)) {
|
|
14612
|
+
throw new Error('Failed to retrieve blob');
|
|
14613
|
+
}
|
|
14615
14614
|
var type = blob.type;
|
|
14616
14615
|
if (type) {
|
|
14617
14616
|
type = type.split('/')[0];
|
|
@@ -14625,13 +14624,17 @@ module.exports = function (Data) {
|
|
|
14625
14624
|
self._peaks.emit('data.retrieved', data, src, url);
|
|
14626
14625
|
});
|
|
14627
14626
|
}
|
|
14627
|
+
}).catch(function (err) {
|
|
14628
|
+
return later(delay).then(function () {
|
|
14629
|
+
return recur(timesTried + 1, err);
|
|
14630
|
+
});
|
|
14628
14631
|
});
|
|
14629
14632
|
}
|
|
14630
14633
|
return recur(0);
|
|
14631
14634
|
};
|
|
14632
14635
|
return DataRetriever;
|
|
14633
|
-
}(_dereq_('./data'));
|
|
14634
|
-
},{"./data":88}],88:[function(_dereq_,module,exports){
|
|
14636
|
+
}(_dereq_('./data'), _dereq_('../utils'));
|
|
14637
|
+
},{"../utils":116,"./data":88}],88:[function(_dereq_,module,exports){
|
|
14635
14638
|
module.exports = function () {
|
|
14636
14639
|
'use strict';
|
|
14637
14640
|
function Data(type, content) {
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
define([
|
|
10
|
-
'./data'
|
|
11
|
-
|
|
10
|
+
'./data',
|
|
11
|
+
'../utils'
|
|
12
|
+
], function(Data, Utils) {
|
|
12
13
|
'use strict';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -84,13 +85,11 @@ define([
|
|
|
84
85
|
|
|
85
86
|
return response.blob();
|
|
86
87
|
})
|
|
87
|
-
.catch(function(err) {
|
|
88
|
-
return later(delay)
|
|
89
|
-
.then(function() {
|
|
90
|
-
return recur(timesTried + 1, err);
|
|
91
|
-
});
|
|
92
|
-
})
|
|
93
88
|
.then(function(blob) {
|
|
89
|
+
if (Utils.isNullOrUndefined(blob)) {
|
|
90
|
+
throw new Error('Failed to retrieve blob');
|
|
91
|
+
}
|
|
92
|
+
|
|
94
93
|
var type = blob.type;
|
|
95
94
|
|
|
96
95
|
if (type) {
|
|
@@ -108,6 +107,12 @@ define([
|
|
|
108
107
|
self._peaks.emit('data.retrieved', data, src, url);
|
|
109
108
|
});
|
|
110
109
|
}
|
|
110
|
+
})
|
|
111
|
+
.catch(function(err) {
|
|
112
|
+
return later(delay)
|
|
113
|
+
.then(function() {
|
|
114
|
+
return recur(timesTried + 1, err);
|
|
115
|
+
});
|
|
111
116
|
});
|
|
112
117
|
}
|
|
113
118
|
|