Skip to content

Commit

Permalink
call priority before default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
purplenicole730 committed Oct 24, 2023
1 parent 53106cf commit c648352
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/robot/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ export class RobotClient extends EventDispatcher implements Robot {
}

public async connect(
priority?: number,
authEntity = this.savedAuthEntity,
creds = this.savedCreds,
priority?: number
creds = this.savedCreds
) {
if (this.connecting) {
// This lint is clearly wrong due to how the event loop works such that after an await, the condition may no longer be true.
Expand Down Expand Up @@ -405,7 +405,7 @@ export class RobotClient extends EventDispatcher implements Robot {
webrtcOptions: {
disableTrickleICE: false,
rtcConfig: this.webrtcOptions?.rtcConfig,
priority: priority,
priority,
},
};

Expand Down
4 changes: 2 additions & 2 deletions src/robot/dial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const dialDirect = async (conf: DialDirectConf): Promise<RobotClient> => {
if (conf.credential) {
creds = conf.credential;
}
await client.connect(conf.authEntity, creds);
await client.connect(undefined, conf.authEntity, creds);

// eslint-disable-next-line no-console
console.debug('connected via gRPC');
Expand Down Expand Up @@ -121,7 +121,7 @@ const dialWebRTC = async (conf: DialWebRTCConf): Promise<RobotClient> => {
if (conf.credential) {
creds = conf.credential;
}
await client.connect(conf.authEntity || impliedURL, creds, conf.priority);
await client.connect(conf.priority, conf.authEntity || impliedURL, creds);

// eslint-disable-next-line no-console
console.debug('connected via WebRTC');
Expand Down

0 comments on commit c648352

Please sign in to comment.