@barchart/portfolio-api-common 1.2.88 → 1.2.89
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.
|
@@ -284,12 +284,12 @@ module.exports = (() => {
|
|
|
284
284
|
|
|
285
285
|
const existingBarchartSymbols = this.getPositionSymbols(false);
|
|
286
286
|
|
|
287
|
-
let
|
|
287
|
+
let similarPositionItem;
|
|
288
288
|
|
|
289
|
-
if (
|
|
290
|
-
|
|
289
|
+
if (extractSymbolForBarchart(position)) {
|
|
290
|
+
similarPositionItem = this._items.find(item => extractSymbolForBarchart(item.position) === extractSymbolForBarchart(position)) || null;
|
|
291
291
|
} else {
|
|
292
|
-
|
|
292
|
+
similarPositionItem = null;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
removePositionItem.call(this, this._items.find(item => item.position.position === position.position));
|
|
@@ -339,13 +339,13 @@ module.exports = (() => {
|
|
|
339
339
|
this._positionSymbolAddedEvent.fire(addedBarchartSymbol);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
if (
|
|
343
|
-
if (
|
|
344
|
-
item.setQuote(
|
|
342
|
+
if (similarPositionItem !== null) {
|
|
343
|
+
if (similarPositionItem.previousQuote) {
|
|
344
|
+
item.setQuote(similarPositionItem.previousQuote);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
if (
|
|
348
|
-
item.setQuote(
|
|
347
|
+
if (similarPositionItem.quote) {
|
|
348
|
+
item.setQuote(similarPositionItem.quote);
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -1663,12 +1663,12 @@ module.exports = (() => {
|
|
|
1663
1663
|
|
|
1664
1664
|
const existingBarchartSymbols = this.getPositionSymbols(false);
|
|
1665
1665
|
|
|
1666
|
-
let
|
|
1666
|
+
let similarPositionItem;
|
|
1667
1667
|
|
|
1668
|
-
if (
|
|
1669
|
-
|
|
1668
|
+
if (extractSymbolForBarchart(position)) {
|
|
1669
|
+
similarPositionItem = this._items.find(item => extractSymbolForBarchart(item.position) === extractSymbolForBarchart(position)) || null;
|
|
1670
1670
|
} else {
|
|
1671
|
-
|
|
1671
|
+
similarPositionItem = null;
|
|
1672
1672
|
}
|
|
1673
1673
|
|
|
1674
1674
|
removePositionItem.call(this, this._items.find(item => item.position.position === position.position));
|
|
@@ -1718,13 +1718,13 @@ module.exports = (() => {
|
|
|
1718
1718
|
this._positionSymbolAddedEvent.fire(addedBarchartSymbol);
|
|
1719
1719
|
}
|
|
1720
1720
|
|
|
1721
|
-
if (
|
|
1722
|
-
if (
|
|
1723
|
-
item.setQuote(
|
|
1721
|
+
if (similarPositionItem !== null) {
|
|
1722
|
+
if (similarPositionItem.previousQuote) {
|
|
1723
|
+
item.setQuote(similarPositionItem.previousQuote);
|
|
1724
1724
|
}
|
|
1725
1725
|
|
|
1726
|
-
if (
|
|
1727
|
-
item.setQuote(
|
|
1726
|
+
if (similarPositionItem.quote) {
|
|
1727
|
+
item.setQuote(similarPositionItem.quote);
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
1730
|
|