Skip to content

Commit

Permalink
fix: logic error (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewchang0910 authored Aug 29, 2023
1 parent eb1930d commit bd275c3
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 29 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/cxws.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions dist/src/exchanges/OrderlyPrivateClient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/exchanges/OrderlyPrivateClient.js.map

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions src/exchanges/OrderlyPrivateClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,23 +256,25 @@ export class OrderlyPrivateClient extends BasicPrivateClient {
protected _processsMessage(msg: any) {
console.log("_processsMessage", msg);
// clear semaphore on subscription event reply
if (!msg.event) {
if (!msg) {
return;
}

switch (msg.event) {
case "ping":
this._sendPong();
return;
case "pong":
return;
// { id: '123r333', event: 'auth', success: true, ts: 1691126241419 }
case "auth":
this.emit("login", msg);
super._onConnected();
return;
default:
return;
if(msg?.event){
switch (msg.event) {
case "ping":
this._sendPong();
return;
case "pong":
return;
// { id: '123r333', event: 'auth', success: true, ts: 1691126241419 }
case "auth":
this.emit("login", msg);
super._onConnected();
return;
default:
return;
}
}

// order update
Expand Down

0 comments on commit bd275c3

Please sign in to comment.