From 8837f56540ea4bfad331e2ff958c30a7d87e5ed7 Mon Sep 17 00:00:00 2001 From: wisplite Date: Thu, 23 Apr 2026 08:58:45 -0500 Subject: [PATCH] build --- dist/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6d8782d..fbd2c96 100644 --- a/dist/index.js +++ b/dist/index.js @@ -47,14 +47,15 @@ export class TetherClient { mutation_id: mutation_id })); return new Promise((resolve, reject) => { - this.websocketHandler.onMutation = (mutation_id, data) => { - if (mutation_id === mutation_id) { + const timeoutId = setTimeout(() => { + reject(new Error('Mutation timeout')); + }, 10000); + this.websocketHandler.onMutation = (incoming_id, data) => { + if (incoming_id === mutation_id) { + clearTimeout(timeoutId); resolve(data); } }; - setTimeout(() => { - reject(new Error('Mutation timeout')); - }, 10000); }); }; }