@barchart/portfolio-api-common 1.0.154 → 1.0.155

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.
@@ -170,8 +170,11 @@ module.exports = (() => {
170
170
  this._dataFormat.quoteTime = this._dataActual.quoteTime;
171
171
  this._dataFormat.quoteVolume = formatNumber(this._dataActual.quoteVolume, 0);
172
172
 
173
- setTimeout(() => this._dataFormat.quoteChangeDirection = { up: this._dataActual.quoteChange.getIsPositive(), down: this._dataActual.quoteChange.getIsNegative() }, 0);
174
- this._dataFormat.quoteChangeNegative = this._dataActual.quoteChange.getIsNegative();
173
+ const quoteChangePositive = is.number(this._dataActual.quoteChange) && this._dataActual.quoteChange.getIsPositive() > 0;
174
+ const quoteChangeNegative = is.number(this._dataActual.quoteChange) && this._dataActual.quoteChange.getIsPositive() < 0;
175
+
176
+ setTimeout(() => this._dataFormat.quoteChangeDirection = { up: quoteChangePositive, down: quoteChangeNegative }, 0);
177
+ this._dataFormat.quoteChangeNegative = quoteChangeNegative;
175
178
  } else {
176
179
  this._dataActual.currentPrice = null;
177
180
  this._dataFormat.currentPrice = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.154",
3
+ "version": "1.0.155",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1415,8 +1415,11 @@ module.exports = (() => {
1415
1415
  this._dataFormat.quoteTime = this._dataActual.quoteTime;
1416
1416
  this._dataFormat.quoteVolume = formatNumber(this._dataActual.quoteVolume, 0);
1417
1417
 
1418
- setTimeout(() => this._dataFormat.quoteChangeDirection = { up: this._dataActual.quoteChange.getIsPositive(), down: this._dataActual.quoteChange.getIsNegative() }, 0);
1419
- this._dataFormat.quoteChangeNegative = this._dataActual.quoteChange.getIsNegative();
1418
+ const quoteChangePositive = is.number(this._dataActual.quoteChange) && this._dataActual.quoteChange.getIsPositive() > 0;
1419
+ const quoteChangeNegative = is.number(this._dataActual.quoteChange) && this._dataActual.quoteChange.getIsPositive() < 0;
1420
+
1421
+ setTimeout(() => this._dataFormat.quoteChangeDirection = { up: quoteChangePositive, down: quoteChangeNegative }, 0);
1422
+ this._dataFormat.quoteChangeNegative = quoteChangeNegative;
1420
1423
  } else {
1421
1424
  this._dataActual.currentPrice = null;
1422
1425
  this._dataFormat.currentPrice = null;