diff --git a/client/components/main/Main/ConnectionSelector/Config.jsx b/client/components/main/Main/ConnectionSelector/Config.jsx index 9839e421..3238617f 100644 --- a/client/components/main/Main/ConnectionSelector/Config.jsx +++ b/client/components/main/Main/ConnectionSelector/Config.jsx @@ -55,6 +55,18 @@ class Config extends React.Component { this.setProp(property, value); } + duplicate() { + if (this.props.favorite) { + const data = Object.assign(this.props.favorite.toJS(), this.state.data.toJS()); + delete data.key; + this.props.onDuplicate(data); + } else { + const data = this.state.data.toJS(); + data.name = 'Quick Connect' + this.props.onDuplicate(data); + } + } + save() { if (this.props.favorite && this.state.changed) { this.props.onSave(this.state.data.toJS()); @@ -141,6 +153,11 @@ class Config extends React.Component {
+ diff --git a/client/components/main/Main/ConnectionSelector/index.jsx b/client/components/main/Main/ConnectionSelector/index.jsx index 73d589a1..f9e9322c 100644 --- a/client/components/main/Main/ConnectionSelector/index.jsx +++ b/client/components/main/Main/ConnectionSelector/index.jsx @@ -34,6 +34,9 @@ class ConnectionSelector extends React.Component { onSave={(data) => { store.dispatch(actions('updateFavorite', { key: selectedFavorite.get('key'), data })); }} + onDuplicate={(data) => { + store.dispatch(actions('addFavorite', data, () => {})); + }} />
;