Skip to content

Commit ee94c90

Browse files
committed
INT-788 fixes the when "connect to" flashes the previous connect dialog bug
1 parent 56b57ee commit ee94c90

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

src/connect/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,7 @@ var ConnectView = View.extend({
438438
window.location.origin,
439439
connection.getId())
440440
);
441-
setTimeout(this.set.bind(this, {
442-
message: ''
443-
}), 500);
444-
setTimeout(window.close, 1000);
441+
app.sendMessage('close connect');
445442
},
446443

447444
/**

src/electron/menu.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,7 @@ function darwinMenu(menuState) {
221221
darwinCompassSubMenu()
222222
];
223223

224-
if (menuState.showConnect) {
225-
menu.push(connectSubMenu(false));
226-
}
227-
224+
menu.push(connectSubMenu(false));
228225
menu.push(editSubMenu());
229226
menu.push(viewSubMenu());
230227

@@ -262,10 +259,6 @@ var MenuState = State.extend({
262259
type: 'boolean',
263260
default: false
264261
},
265-
showConnect: {
266-
type: 'boolean',
267-
default: true
268-
},
269262
showShare: {
270263
type: 'boolean',
271264
default: false
@@ -306,7 +299,6 @@ var AppMenu = (function() {
306299

307300
debug('WINDOW\'s ' + winID + ' Menu State');
308301
debug('showCompassOverview: ' + menuState.showCompassOverview);
309-
debug('showConnect: ' + menuState.showConnect);
310302
debug('showShare: ' + menuState.showShare);
311303

312304
if (process.platform === 'darwin') {
@@ -348,10 +340,6 @@ var AppMenu = (function() {
348340
},
349341

350342
// share/hide submenu fns
351-
hideConnect: function(_window) {
352-
this.updateMenu('showConnect', false, _window);
353-
},
354-
355343
hideShare: function() {
356344
this.updateMenu('showShare', false);
357345
},
@@ -360,10 +348,6 @@ var AppMenu = (function() {
360348
this.updateMenu('showCompassOverview', true);
361349
},
362350

363-
showConnect: function() {
364-
this.updateMenu('showConnect', true);
365-
},
366-
367351
showShare: function() {
368352
this.updateMenu('showShare', true);
369353
},

src/electron/window-manager.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports.create = function(opts) {
8686
url: DEFAULT_URL
8787
});
8888

89-
debug('creating new window');
89+
debug('creating new window: ' + opts.url);
9090
var _window = new BrowserWindow({
9191
width: opts.width,
9292
height: opts.height,
@@ -136,6 +136,11 @@ function createWindow(opts, url) {
136136
return module.exports.create(opts);
137137
}
138138

139+
app.on('close connect', function() {
140+
connectWindow.close();
141+
connectWindow = null;
142+
});
143+
139144
app.on('show about dialog', function() {
140145
dialog.showMessageBox({
141146
type: 'info',
@@ -155,10 +160,6 @@ app.on('show connect dialog', function(opts) {
155160
debug('connect window focused.');
156161
connectWindow.webContents.send('message', 'connect-window-focused');
157162
});
158-
connectWindow.on('closed', function() {
159-
debug('connect window closed.');
160-
connectWindow = null;
161-
});
162163
});
163164

164165
app.on('hide share submenu', function() {

0 commit comments

Comments
 (0)