Skip to content

Commit 1871b19

Browse files
committed
Merge pull request #344 from uProxy/trevj-inviteuser-fix
fix issue where inviteUser rejects
2 parents 6166872 + 8e21be9 commit 1871b19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cloud/social/provider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,15 @@ export class CloudSocialProvider {
366366
// TODO: typings for invite codes
367367
public inviteUser = (clientId: string): Promise<Object> => {
368368
log.debug('inviteUser');
369-
if (!(clientId in this.clients_)) {
370-
return Promise.reject(new Error('unknown client ' + clientId));
369+
if (!(clientId in this.savedContacts_)) {
370+
return Promise.reject(new Error('unknown cloud instance ' + clientId));
371371
}
372372
if (this.savedContacts_[clientId].invite.user !== ADMIN_USERNAME) {
373373
return Promise.reject(new Error('user is logged in as non-admin user ' +
374374
this.savedContacts_[clientId].invite.user));
375375
}
376-
return this.clients_[clientId].then((connection: Connection) => {
376+
return this.reconnect_(this.savedContacts_[clientId].invite).then(
377+
(connection: Connection) => {
377378
return connection.issueInvite();
378379
});
379380
}

0 commit comments

Comments
 (0)