From 87f7c08f8a201332257bba42a34a961e24c674c7 Mon Sep 17 00:00:00 2001 From: Navy Date: Tue, 14 Apr 2020 22:01:32 +0300 Subject: [PATCH] actually delete transaction once it's concluded --- structure/client/TransactionHandler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/structure/client/TransactionHandler.js b/structure/client/TransactionHandler.js index a556468..ca6b190 100644 --- a/structure/client/TransactionHandler.js +++ b/structure/client/TransactionHandler.js @@ -15,12 +15,16 @@ class TransactionHandler { _receive(message) { - if(!message.transactionID) return; + if(!message.transactionID) return undefined; const transaction = this.transactions.get(message.transactionID); + if(!transaction) return undefined; + if(message.error) transaction.reject(message.message); else transaction.resolve(message.result); + this.transactions.delete(message.transactionID); + } _send(message, options = {}) {