fixed a shadowing bug

This commit is contained in:
2026-04-23 08:58:37 -05:00
parent dca7ea5707
commit 5861bb4e72
+6 -5
View File
@@ -52,14 +52,15 @@ export class TetherClient {
mutation_id: mutation_id mutation_id: mutation_id
})); }));
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.websocketHandler.onMutation = (mutation_id: string, data: any) => { const timeoutId = setTimeout(() => {
if (mutation_id === mutation_id) { reject(new Error('Mutation timeout'));
}, 10000);
this.websocketHandler.onMutation = (incoming_id: string, data: any) => {
if (incoming_id === mutation_id) {
clearTimeout(timeoutId);
resolve(data); resolve(data);
} }
}; };
setTimeout(() => {
reject(new Error('Mutation timeout'));
}, 10000);
}); });
}; };
} }