Remove hash when joining a team with a link

pull/1/head
yflory 5 years ago
parent 18c342760a
commit c2c5dbdb64

@ -1440,7 +1440,6 @@ define([
var json = Util.tryParse(val); var json = Util.tryParse(val);
if (!json) { return void cb({ error: "parseError" }); } if (!json) { return void cb({ error: "parseError" }); }
console.error("JSON", json);
cb(json); cb(json);
}, { // cryptget opts }, { // cryptget opts
network: ctx.store.network, network: ctx.store.network,

@ -1059,6 +1059,7 @@ define([
var hashData = Hash.parseTypeHash('invite', hash); var hashData = Hash.parseTypeHash('invite', hash);
var password = hashData.password; var password = hashData.password;
var seeds = InviteInner.deriveSeeds(hashData.key); var seeds = InviteInner.deriveSeeds(hashData.key);
var sframeChan = common.getSframeChannel();
if (Object.keys(privateData.teams || {}).length >= Constants.MAX_TEAMS_SLOTS) { if (Object.keys(privateData.teams || {}).length >= Constants.MAX_TEAMS_SLOTS) {
return void cb([ return void cb([
@ -1146,6 +1147,7 @@ define([
return; return;
} }
// No error: join successful! // No error: join successful!
sframeChan.event('EV_SET_HASH', '');
var $div = $('div.cp-team-list').empty(); var $div = $('div.cp-team-list').empty();
refreshList(common, function (content) { refreshList(common, function (content) {
$div.append(content); $div.append(content);
@ -1170,7 +1172,6 @@ define([
nThen(function (waitFor) { nThen(function (waitFor) {
// Get preview content. // Get preview content.
var sframeChan = common.getSframeChannel();
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) { sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) {
if (json && (json.error || !Object.keys(json).length)) { if (json && (json.error || !Object.keys(json).length)) {
$(errorBlock).text(Messages.team_inviteInvalidLinkError).show(); $(errorBlock).text(Messages.team_inviteInvalidLinkError).show();

Loading…
Cancel
Save