From fc8ee58cfb9469ef3d4dc992de61a8a2bb3a6549 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 18 Dec 2019 12:09:37 +0100 Subject: [PATCH] Fix joinTeam undefined data --- www/common/outer/team.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 81f1f88b0..81fe1b82f 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1474,6 +1474,7 @@ define([ var acceptLinkInvitation = function (ctx, data, cId, cb) { var inviteContent; nThen(function (waitFor) { + // Get team keys and ephemeral keys getInviteContent(ctx, data, cId, waitFor(function (obj) { if (obj && obj.error) { waitFor.abort(); @@ -1482,6 +1483,7 @@ define([ inviteContent = obj; })); }).nThen(function (waitFor) { + // Accept the roster invitation: relplace our ephemeral keys with our user keys var rosterData = Util.find(inviteContent, ['teamData', 'keys', 'roster']); var myKeys = inviteContent.ephemeral; var rosterKeys = Crypto.Team.deriveMemberKeys(rosterData.edit, myKeys); @@ -1508,7 +1510,10 @@ define([ })); })); }).nThen(function () { - joinTeam(ctx, inviteContent.teamData, cId, cb); + // Add the team to our list and join... + joinTeam(ctx, { + team: inviteContent.teamData + }, cId, cb); }); };