From 4ccc406768905e73a72abc5e793b3e1907bc2ba7 Mon Sep 17 00:00:00 2001 From: Zenghai Liang Date: Wed, 14 Oct 2020 16:40:14 +0800 Subject: [PATCH] Using Object.assign to copy connection --- terminus-ssh/src/components/sshSettingsTab.component.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/terminus-ssh/src/components/sshSettingsTab.component.ts b/terminus-ssh/src/components/sshSettingsTab.component.ts index 7c609026..568d35b2 100644 --- a/terminus-ssh/src/components/sshSettingsTab.component.ts +++ b/terminus-ssh/src/components/sshSettingsTab.component.ts @@ -47,9 +47,8 @@ export class SSHSettingsTabComponent { } copyConnection (connection) { - connection.name += ' Copy' const modal = this.ngbModal.open(EditConnectionModalComponent) - modal.componentInstance.connection = connection + modal.componentInstance.connection = Object.assign({name: name + ' Copy'}, connection) modal.result.then(result => { this.connections.push(result) this.config.store.ssh.connections = this.connections