Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/app/connect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ var ConnectView = View.extend({
this.listenToAndRun(this, 'change:sshTunnelMethod',
this.replaceSshTunnelMethodFields.bind(this));

this.listenToAndRun(app, 'connect-window-focused',
// add event listener to focus event and also check on app launch
ipc.on('app:connect-window-focused',
this.onConnectWindowFocused.bind(this));
this.onConnectWindowFocused();

// always start in NEW_EMPTY state
this.dispatch('new connection clicked');
Expand All @@ -288,7 +290,9 @@ var ConnectView = View.extend({
* a MongoDB URI was detected.
*/
autofillFromClipboard: function() {
this.connection = MongoDBConnection.from(this.clipboardText);
this.connection = Connection.from(this.clipboardText);
// don't use "Local" as favorite name, keep field empty
this.connection.name = '';
this.updateForm();
},

Expand Down
3 changes: 3 additions & 0 deletions src/main/window-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ function showConnectWindow() {
debug('connect window closed.');
connectWindow = null;
});
connectWindow.on('focus', function() {
connectWindow.webContents.send('app:connect-window-focused');
});
}

function closeConnectWindow() {
Expand Down