Skip to content

Commit

Permalink
onConnect command tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
DumpySquare committed Sep 8, 2020
1 parent 6ea0d48 commit 9c625c6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/utils/f5DeviceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,19 @@ export class MgmtClient {
const bigipHosts: Device[] | undefined = workspace.getConfiguration().get('f5.hosts');
const deviceConfig: any = bigipHosts?.find( item => item.device === this.device);

if (deviceConfig?.hasOwnProperty('onConnect')) {
this._onConnect = deviceConfig.onConnect;
} else if (deviceConfig?.hasOwnProperty('onDisconnect')) {
this._onConnect = deviceConfig.onDisconnect;
}
// if (deviceConfig?.hasOwnProperty('onConnect')) {
// this._onConnect = deviceConfig.onConnect;
// }

// if (deviceConfig?.hasOwnProperty('onDisconnect')) {
// this._onDisconnect = deviceConfig.onDisconnect;
// }

// short hand of above logic
deviceConfig?.hasOwnProperty('onConnect') ? this._onConnect = deviceConfig.onConnect : [];
deviceConfig?.hasOwnProperty('onDisconnect') ? this._onDisconnect = deviceConfig.onDisconnect : [];

console.log('done getConfig');
}


Expand Down

0 comments on commit 9c625c6

Please sign in to comment.