@open-tender/store 1.1.43 → 1.1.45

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.
@@ -13,7 +13,7 @@ var Upsells = function (_a) {
13
13
  var itemLookup = (0, react_1.useMemo)(function () { return (0, utils_1.makeMenuItemLookup)(categories); }, [categories]);
14
14
  var items = (0, utils_1.makeUpsellItems)(itemIds, itemLookup);
15
15
  var handlers = { close: close };
16
- var renderUpsellItem = (0, react_1.useCallback)(function (item, isLast) { return (react_1.default.createElement(UpsellItem_1.default, { key: item.id, apiUrl: apiUrl, item: item, isLast: isLast, children: UpsellItemView })); }, [apiUrl, UpsellItemView]);
16
+ var renderUpsellItem = (0, react_1.useCallback)(function (item, isLast) { return (react_1.default.createElement(UpsellItem_1.default, { key: item.id, apiUrl: apiUrl, item: item, isLast: isLast, callback: close, children: UpsellItemView })); }, [apiUrl, close, UpsellItemView]);
17
17
  return children({
18
18
  config: config,
19
19
  handlers: handlers,
@@ -55,7 +55,9 @@ var useChipDNATender = function (amount) {
55
55
  return;
56
56
  }
57
57
  var _b = (0, useChipDNATender_utils_1.processMessage)(value), msg = _b.msg, msgType = _b.msgType, token = _b.token;
58
- console.log(value);
58
+ var decoded = new TextDecoder('utf-8').decode(value);
59
+ console.log('done', done);
60
+ console.log(decoded);
59
61
  console.log(msg, msgType, token);
60
62
  if (msg)
61
63
  setMessage(msg);
@@ -5,7 +5,7 @@ var utils_1 = require("@open-tender/utils");
5
5
  var makeMessage = function (event) {
6
6
  if (!event)
7
7
  return null;
8
- var msgType = event.replace('event: ', '');
8
+ var msgType = event.replace('event: ', '').trim();
9
9
  var msg = msgType
10
10
  .split('_')
11
11
  .map(function (s) { return (0, utils_1.capitalize)(s); })
@@ -10,7 +10,7 @@ var Upsells = function (_a) {
10
10
  var itemLookup = useMemo(function () { return makeMenuItemLookup(categories); }, [categories]);
11
11
  var items = makeUpsellItems(itemIds, itemLookup);
12
12
  var handlers = { close: close };
13
- var renderUpsellItem = useCallback(function (item, isLast) { return (React.createElement(UpsellItemContainer, { key: item.id, apiUrl: apiUrl, item: item, isLast: isLast, children: UpsellItemView })); }, [apiUrl, UpsellItemView]);
13
+ var renderUpsellItem = useCallback(function (item, isLast) { return (React.createElement(UpsellItemContainer, { key: item.id, apiUrl: apiUrl, item: item, isLast: isLast, callback: close, children: UpsellItemView })); }, [apiUrl, close, UpsellItemView]);
14
14
  return children({
15
15
  config: config,
16
16
  handlers: handlers,
@@ -53,7 +53,9 @@ var useChipDNATender = function (amount) {
53
53
  return;
54
54
  }
55
55
  var _b = processMessage(value), msg = _b.msg, msgType = _b.msgType, token = _b.token;
56
- console.log(value);
56
+ var decoded = new TextDecoder('utf-8').decode(value);
57
+ console.log('done', done);
58
+ console.log(decoded);
57
59
  console.log(msg, msgType, token);
58
60
  if (msg)
59
61
  setMessage(msg);
@@ -2,7 +2,7 @@ import { capitalize } from '@open-tender/utils';
2
2
  var makeMessage = function (event) {
3
3
  if (!event)
4
4
  return null;
5
- var msgType = event.replace('event: ', '');
5
+ var msgType = event.replace('event: ', '').trim();
6
6
  var msg = msgType
7
7
  .split('_')
8
8
  .map(function (s) { return capitalize(s); })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",