escpos-mc 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. package/index.js +5 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -825,9 +825,9 @@ Printer.prototype.beep = function (n, t) {
825
825
  this.adapter.write(buf, (err) => {
826
826
  // ako smo poslali buffer, možemo ranije da otpustimo status lock
827
827
  // (ali ne odmah — ostavi malo prostora da printer obradi)
828
- setTimeout(() => {
828
+ if (this._dontCheckTimeout) clearTimeout(this._dontCheckTimeout);
829
+ this._dontCheckTimeout = setTimeout(() => {
829
830
  this._dontCheckStatus = false;
830
- if (this._dontCheckTimeout) clearTimeout(this._dontCheckTimeout);
831
831
  this._dontCheckTimeout = null;
832
832
  }, 1500);
833
833
 
@@ -844,12 +844,12 @@ Printer.prototype.beep = function (n, t) {
844
844
  callback && callback(null);
845
845
  return this;
846
846
  }
847
- this.adapter.write(buf, (err) => {
847
+ this.adapter.write(b, (err) => {
848
848
  // ako smo poslali buffer, možemo ranije da otpustimo status lock
849
849
  // (ali ne odmah — ostavi malo prostora da printer obradi)
850
- setTimeout(() => {
850
+ if (this._dontCheckTimeout) clearTimeout(this._dontCheckTimeout);
851
+ this._dontCheckTimeout = setTimeout(() => {
851
852
  this._dontCheckStatus = false;
852
- if (this._dontCheckTimeout) clearTimeout(this._dontCheckTimeout);
853
853
  this._dontCheckTimeout = null;
854
854
  }, 1500);
855
855
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escpos-mc",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "My temp ESC/POS Printer driver for nodejs",
5
5
  "main": "index.js",
6
6
  "scripts": {