binbot-charts 0.2.21 → 0.2.22

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.
@@ -34,7 +34,7 @@ function TVChartContainer(_ref) {
34
34
  } = _ref;
35
35
  const containerRef = (0, _react.useRef)(null);
36
36
  const [chartOrderLines, setChartOrderLines] = (0, _useImmer.useImmer)([]);
37
- const [widgetState, setWidgetState] = (0, _react.useState)(null);
37
+ const [widgetState, setWidgetState] = (0, _useImmer.useImmer)(null);
38
38
  const [symbolState] = (0, _react.useState)(null);
39
39
  (0, _react.useEffect)(() => {
40
40
  if (!widgetState) {
@@ -100,7 +100,9 @@ function TVChartContainer(_ref) {
100
100
  const lineStyle = order.lineStyle || 0;
101
101
  let chartOrderLine = widgetState.chart().createOrderLine().setText(order.text).setTooltip(order.tooltip).setQuantity(order.quantity).setQuantityFont("inherit 14px Arial").setQuantityBackgroundColor(order.color).setQuantityBorderColor(order.color).setLineStyle(lineStyle).setLineLength(25).setLineColor(order.color).setBodyFont("inherit 14px Arial").setBodyBorderColor(order.color).setBodyTextColor(order.color).setPrice(order.price); // set custom id easier search
102
102
 
103
- chartOrderLine.id = order.id;
103
+ setWidgetState(produce(d => {
104
+ draft.id = order.id;
105
+ }));
104
106
  setChartOrderLines(draft => {
105
107
  draft.push(chartOrderLine);
106
108
  return draft;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.21",
2
+ "version": "0.2.22",
3
3
  "name": "binbot-charts",
4
4
  "dependencies": {
5
5
  "react": "^17.0.1",