mirror of
https://github.com/wisplite/tether-ts.git
synced 2026-05-01 06:22:41 -05:00
build
This commit is contained in:
Vendored
+6
-5
@@ -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);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user