Skip to content

Commit fad69fa

Browse files
committed
🐛 serialize all connection details for now
until we get time to properly use keytar to put them in keychain, we need to be able to look them up for now though when opening new schema window.
1 parent 6eeea45 commit fad69fa

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/connect/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ var ConnectView = View.extend({
161161
evt.preventDefault();
162162
this.toggle('authOpen');
163163
if (this.authOpen) {
164-
this.authMethod = 'MONGODB';
164+
if (this.previousAuthMethod === 'NONE') {
165+
this.authMethod = 'MONGODB';
166+
} else {
167+
this.authMethod = this.previousAuthMethod;
168+
}
165169
} else {
166170
this.authMethod = 'NONE';
167171
}

src/models/connection.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@ module.exports = Connection.extend({
2626
test: function(done) {
2727
var model = this;
2828
debug('Testing connection to `%j`...', this);
29-
client.test(app.endpoint, model.serialize({all: true}), function(err) {
29+
client.test(app.endpoint, model.serialize({
30+
all: true
31+
}), function(err) {
3032
if (err) {
3133
bugsnag.notify(err, 'connection test failed');
3234
return done(err);
3335
}
3436

3537
debug('test worked!');
3638
debug('making sure we can get collection list...');
37-
client(app.endpoint, model.serialize({all: true})).instance(function(err, res) {
39+
client(app.endpoint, model.serialize({
40+
all: true
41+
})).instance(function(err, res) {
3842
if (!err) {
3943
debug('woot. all gravy! able to see %s collections', res.collections.length);
4044
done(null, model);
@@ -47,5 +51,10 @@ module.exports = Connection.extend({
4751
});
4852
return this;
4953
},
50-
sync: connectionSync
54+
sync: connectionSync,
55+
serialize: function(){
56+
return Connection.prototype.serialize.call(this, {
57+
all: true
58+
});
59+
}
5160
});

0 commit comments

Comments
 (0)