Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
update connection
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Dec 30, 2017
1 parent c1254cf commit 1fce81d
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions connectionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,20 +374,6 @@
}

events.trigger(self, 'apiclientcreated', [apiClient]);

if (existingServer.Id) {
return;
}

apiClient.getPublicSystemInfo().then(function (systemInfo) {

var credentials = credentialProvider.credentials();
existingServer.Id = systemInfo.Id;
apiClient.serverInfo(existingServer);

credentials.Servers = [existingServer];
credentialProvider.credentials(credentials);
});
};

self.clearData = function () {
Expand Down Expand Up @@ -1067,7 +1053,7 @@
});

}
else if (result.Id !== server.Id) {
else if (server.Id && result.Id !== server.Id) {

console.log('http request succeeded, but found a different server Id than what was expected');
resolveFailure(self, resolve);
Expand Down Expand Up @@ -1193,19 +1179,12 @@
});
}

return tryConnect(address, defaultTimeout).then(function (publicInfo) {

console.log('connectToAddress ' + address + ' succeeded');

var server = {
ManualAddress: address,
LastConnectionMode: ConnectionMode.Manual
};
updateServerInfo(server, publicInfo);

return self.connectToServer(server, options).catch(onFail);
var server = {
ManualAddress: address,
LastConnectionMode: ConnectionMode.Manual
};

}, onFail);
return self.connectToServer(server, options).catch(onFail);
};

self.loginToConnect = function (username, password) {
Expand Down

0 comments on commit 1fce81d

Please sign in to comment.