Skip to content

Commit

Permalink
fix: callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
kybarg committed Aug 5, 2022
1 parent 9597295 commit 65d7bbc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class RPUPrinter {
fromEvents(this.eventEmitter, ['SUCCESS'], ['ERROR', 'TIMED_OUT', 'CLOSE'])
.then(
({ args }) => {
this.processing = false;
this.currentCommand = null;
try {
const result = decode(this.currentCommand, args.slice()[0]);
resolve(result);
Expand All @@ -137,12 +139,10 @@ class RPUPrinter {
},
)
.catch(({ args }) => {
reject(args);
})
.finally(() => {
this.processing = false;
this.currentCommand = null;
});
reject(args);
})
});

};
Expand Down

0 comments on commit 65d7bbc

Please sign in to comment.