Skip to content

Commit 6d04924

Browse files
authored
Merge pull request #28 from beclab/feat/update-websocket-status
feat: on open set status before notify bean
2 parents f829293 + a438a43 commit 6d04924

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bytetrade/core",
3-
"version": "0.3.83",
3+
"version": "0.3.84",
44
"description": "didvault core module",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/websocket/WebSocketBean.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ export class WebSocketBean implements IWebSocketBean {
3333
// Notify connection success or reconnection success
3434
this.reconnect.stop();
3535

36+
// Update status to connected
37+
this.status = WebSocketStatusEnum.open;
38+
3639
// Call lifecycle method
3740
if (this.param.onopen) await this.param.onopen();
3841

3942
if (restart && this.param.onReconnectSuccess) {
4043
await this.param.onReconnectSuccess();
4144
}
4245

43-
// Update status to connected
44-
this.status = WebSocketStatusEnum.open;
45-
4646
// Notify to send data
4747
this.sendObj.onopen();
4848
};

0 commit comments

Comments
 (0)