This commit is contained in:
2026-04-23 08:51:36 -05:00
parent 44fe4c63c4
commit 6ee7b5ac34
4 changed files with 18 additions and 1 deletions
+12
View File
@@ -39,10 +39,22 @@ export class TetherClient {
}));
};
sendMutation = (mutationName, params) => {
const mutation_id = crypto.randomUUID();
this.websocketHandler.send(JSON.stringify({
type: 'mutation',
location: mutationName,
params: params,
mutation_id: mutation_id
}));
return new Promise((resolve, reject) => {
this.websocketHandler.onMutation = (data) => {
if (data.mutation_id === mutation_id) {
resolve(data);
}
};
setTimeout(() => {
reject(new Error('Mutation timeout'));
}, 10000);
});
};
}