Skip to content

Commit

Permalink
perf: 修复所有连接方式动作为拒绝时控制台报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
huailei000 committed Jun 13, 2023
1 parent 1794cc4 commit da566eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ElementAdvancedOptionComponent implements OnChanges {
label: 'Charset',
hidden: () => {
const protocolsCanCharset: Array<string> = ['ssh', 'telnet'];
return this.connectMethod.component !== 'koko' || !protocolsCanCharset.includes(this.protocol.name);
return this.connectMethod && this.connectMethod.component !== 'koko' || !protocolsCanCharset.includes(this.protocol.name);
},
value: 'default',
options: [
Expand All @@ -46,7 +46,7 @@ export class ElementAdvancedOptionComponent implements OnChanges {
field: 'disableautohash',
hidden: () => {
const protocolsCanAutoHash: Array<string> = ['mysql', 'mariadb'];
return this.connectMethod.component !== 'koko' || !protocolsCanAutoHash.includes(this.protocol.name);
return this.connectMethod && this.connectMethod.component !== 'koko' || !protocolsCanAutoHash.includes(this.protocol.name);
},
label: 'Disable auto completion',
value: false,
Expand All @@ -67,7 +67,7 @@ export class ElementAdvancedOptionComponent implements OnChanges {
type: 'select',
field: 'backspaceAsCtrlH',
hidden: () => {
return this.connectMethod.component !== 'koko';
return this.connectMethod && this.connectMethod.component !== 'koko';
},
options: this.boolChoices,
label: 'Backspace as Ctrl+H',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3>{{"Connect" | translate}} - {{ asset.name | truncatechars:30 }}</h3>
<elements-connect-method
class="connect-method-zone"
[protocol]="protocol"
[(connectMethod)]="connectMethod"
[connectMethod]="connectMethod"
(onDownloadRDPFile)="onConfirm(true)"
>
</elements-connect-method>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ElementConnectMethodComponent implements OnInit {
currentConnectMethodTypeIndex() {
const i = this.connectMethodTypes
.map((item) => item.value)
.indexOf(this.connectMethod.type);
.indexOf(this.connectMethod && this.connectMethod.type);
if (i === -1) {
return 0;
}
Expand Down

0 comments on commit da566eb

Please sign in to comment.