incyclist-services 1.3.10 → 1.3.11
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.
|
@@ -72,9 +72,7 @@ let VeloHeroUpload = (() => {
|
|
|
72
72
|
init() {
|
|
73
73
|
if (this.isInitialized)
|
|
74
74
|
return true;
|
|
75
|
-
console.log('~~~ VeloHeroUpload.init');
|
|
76
75
|
if (!this.getUserSettings().isInitialized) {
|
|
77
|
-
console.log('~~~ VeloHeroUpload.init - usersettings not ready');
|
|
78
76
|
return false;
|
|
79
77
|
}
|
|
80
78
|
try {
|
|
@@ -94,7 +92,6 @@ let VeloHeroUpload = (() => {
|
|
|
94
92
|
this.isInitialized = true;
|
|
95
93
|
}
|
|
96
94
|
catch (err) {
|
|
97
|
-
console.log('~~~ VeloHeroUpload.init - error');
|
|
98
95
|
this.logger.logEvent({ message: 'error', error: err.message, fn: 'init', stack: err.stack });
|
|
99
96
|
this.isInitialized = false;
|
|
100
97
|
}
|
|
@@ -90,7 +90,7 @@ class RouteDownloadService extends service_1.IncyclistService {
|
|
|
90
90
|
observer.setSession(session);
|
|
91
91
|
this.logEvent({ message: 'start download', title, id, url });
|
|
92
92
|
session.on('started', () => { observer.emit('started'); });
|
|
93
|
-
session.on('close', () => {
|
|
93
|
+
session.on('close', () => { });
|
|
94
94
|
session.on('progress', (pct, speed, bytes) => { this.onDownloadProgress(id, observer, pct, speed, bytes); });
|
|
95
95
|
session.on('error', observer.emit.bind(observer));
|
|
96
96
|
session.once('done', () => {
|
package/lib/utils/formatting.js
CHANGED
|
@@ -46,7 +46,7 @@ const formatTime = (seconds, cutMissing) => {
|
|
|
46
46
|
};
|
|
47
47
|
exports.formatTime = formatTime;
|
|
48
48
|
const formatNumber = (value, maxDigits, maxLength = -1) => {
|
|
49
|
-
if (value === undefined || isNaN(value))
|
|
49
|
+
if (value === undefined || value === null || isNaN(value))
|
|
50
50
|
return '';
|
|
51
51
|
if (maxLength === -1)
|
|
52
52
|
return value.toFixed(maxDigits).toString();
|