fix json parsing error

This commit is contained in:
2026-04-23 08:54:13 -05:00
parent 6ee7b5ac34
commit dca7ea5707
5 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -47,8 +47,8 @@ export class TetherClient {
mutation_id: mutation_id
}));
return new Promise((resolve, reject) => {
this.websocketHandler.onMutation = (data) => {
if (data.mutation_id === mutation_id) {
this.websocketHandler.onMutation = (mutation_id, data) => {
if (mutation_id === mutation_id) {
resolve(data);
}
};
+1 -1
View File
@@ -8,7 +8,7 @@ export declare class WebSocketHandler {
private maxReconnectAttempts;
private reconnectInterval;
private sendQueue;
onMutation: (data: any) => void;
onMutation: (mutation_id: string, data: any) => void;
startConnection: (url: string) => void;
attemptReconnect: () => void;
close: () => void;
+1 -1
View File
@@ -28,7 +28,7 @@ export class WebSocketHandler {
this.onQuery(data.location, data.data);
}
else if (data.type === 'mutation') {
this.onMutation(data.data);
this.onMutation(data.mutation_id || '', data.data);
}
else if (data.type === 'error') {
console.error(data.error);