ordering-ui-react-native 0.23.15-test → 0.23.15-test3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.23.15-test",
3
+ "version": "0.23.15-test3",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -316,18 +316,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
316
316
  const printAction = async (printerSettings: any, commands: any, showAlert: boolean = true) => {
317
317
  try {
318
318
  var printResult = await StarPRNT.print(printerSettings?.emulation, commands, printerSettings?.portName);
319
- Alert.alert(
320
- 'Print Result',
321
- JSON.stringify(printResult),
322
- [{ text: t('OK', 'Ok')}]
323
- )
324
319
  showAlert && showToast(ToastType.Info, t('ORDER_PRINTED_SUCCESS', 'Order printed'), 1000)
325
320
  } catch (e) {
326
- Alert.alert(
327
- 'Print Result',
328
- JSON.stringify(e),
329
- [{ text: t('OK', 'Ok')}]
330
- )
331
321
  showAlert && showToast(ToastType.Error, t('ORDER_PRINTED_FAILED', 'Order not printed, connection failed'), 1000)
332
322
  }
333
323
  }
@@ -340,11 +330,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
340
330
  orderStatus: getOrderStatus(order?.status, t)?.value
341
331
  }, printer?.printMode)
342
332
  commands.push({ appendCutPaper: StarPRNT.CutPaperAction.PartialCutWithFeed })
343
- Alert.alert(
344
- `Printer: ${printer?.model}`,
345
- `Port name: ${printer?.portName}`,
346
- [{ text: t('OK', 'Ok')}]
347
- )
348
333
  printAction(printer, commands, idx === printerSettings.length - 1)
349
334
  })
350
335
  return
@@ -204,7 +204,7 @@ export const usePrinterCommands = () => {
204
204
  ...commands,
205
205
  ...appends.map((append: any) => {
206
206
  return append === '_separator_'
207
- ? { [printMode]: `---------------------------------------${endLine}` }
207
+ ? { [printMode]: `-------------------------------------${endLine}` }
208
208
  : {
209
209
  [printMode]: replaceChars(append?.text ?? append),
210
210
  ...textProps,
@@ -102,7 +102,7 @@ export const PrinterSettings = (props: any) => {
102
102
  type: type ?? _currentPrinter?.type ?? 1,
103
103
  ip: ip ?? _currentPrinter?.ip ?? '',
104
104
  portName: (type ?? _currentPrinter?.type) === 1 || !ip
105
- ? item.portName1 ?? _currentPrinter?.portName1
105
+ ? item?.bt ?? item.portName1 ?? _currentPrinter?.portName1
106
106
  : `TCP:${ip}`
107
107
  }
108
108
  edit ? (_printers[idx] = _item) : _printers.push(_item)