aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-10-20 11:01:44 +0700
committerShulhan <ms@kilabit.info>2021-10-20 11:01:44 +0700
commiteec686b3c4907a9a83cfdcc9a9b4f8772eda4d9f (patch)
treef438e91b3418f8b1dc4e7c7f9e9b9e0067695ba8
parenta3e4a44ba024f478192a807b94e858d523ad4599 (diff)
downloadpakakeh.ts-eec686b3c4907a9a83cfdcc9a9b4f8772eda4d9f.tar.xz
all: check for response ID 0 to before call onBroadcast
A response is defined as broadcast from server when the ID is 0.
-rw-r--r--websocket_client.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/websocket_client.ts b/websocket_client.ts
index 62d11fc..3d68cd5 100644
--- a/websocket_client.ts
+++ b/websocket_client.ts
@@ -147,7 +147,7 @@ export class WuiWebSocketClient {
}
}
- if (this.opts.onBroadcast) {
+ if (this.opts.onBroadcast && res.id == 0) {
this.opts.onBroadcast(res)
}
}