Fix conflicting curvePublic

pull/1/head
yflory 5 years ago
parent 3cd93b1d52
commit e0782d753d

@ -143,8 +143,8 @@ define([
if (state.members) { if (state.members) {
Object.keys(state.members).forEach(function (curve) { Object.keys(state.members).forEach(function (curve) {
var m = state.members[curve]; var m = state.members[curve];
if (m.inviteChannel) { list.push(m.inviteChannel); } if (m.inviteChannel && m.pending) { list.push(m.inviteChannel); }
if (m.previewChannel) { list.push(m.previewChannel); } if (m.previewChannel && m.pending) { list.push(m.previewChannel); }
}); });
} }
@ -1485,6 +1485,7 @@ define([
var acceptLinkInvitation = function (ctx, data, cId, cb) { var acceptLinkInvitation = function (ctx, data, cId, cb) {
var inviteContent; var inviteContent;
var rosterState;
nThen(function (waitFor) { nThen(function (waitFor) {
// Get team keys and ephemeral keys // Get team keys and ephemeral keys
getInviteContent(ctx, data, cId, waitFor(function (obj) { getInviteContent(ctx, data, cId, waitFor(function (obj) {

@ -748,24 +748,28 @@ define([
var me = roster[userData.curvePublic] || {}; var me = roster[userData.curvePublic] || {};
var owner = Object.keys(roster).filter(function (k) { var owner = Object.keys(roster).filter(function (k) {
if (roster[k].pending) { return; } if (roster[k].pending) { return; }
roster[k].curvePublic = k;
return roster[k].role === "OWNER" || roster[k].pendingOwner; return roster[k].role === "OWNER" || roster[k].pendingOwner;
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me, roster); return makeMember(common, roster[k], me, roster);
}); });
var admins = Object.keys(roster).filter(function (k) { var admins = Object.keys(roster).filter(function (k) {
if (roster[k].pending) { return; } if (roster[k].pending) { return; }
roster[k].curvePublic = k;
return roster[k].role === "ADMIN"; return roster[k].role === "ADMIN";
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me); return makeMember(common, roster[k], me);
}); });
var members = Object.keys(roster).filter(function (k) { var members = Object.keys(roster).filter(function (k) {
if (roster[k].pending) { return; } if (roster[k].pending) { return; }
roster[k].curvePublic = k;
return roster[k].role === "MEMBER" || !roster[k].role; return roster[k].role === "MEMBER" || !roster[k].role;
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me); return makeMember(common, roster[k], me);
}); });
var viewers = Object.keys(roster).filter(function (k) { var viewers = Object.keys(roster).filter(function (k) {
if (roster[k].pending) { return; } if (roster[k].pending) { return; }
roster[k].curvePublic = k;
return roster[k].role === "VIEWER"; return roster[k].role === "VIEWER";
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me); return makeMember(common, roster[k], me);
@ -773,6 +777,7 @@ define([
var pending = Object.keys(roster).filter(function (k) { var pending = Object.keys(roster).filter(function (k) {
if (!roster[k].pending) { return; } if (!roster[k].pending) { return; }
if (roster[k].inviteChannel) { return; } if (roster[k].inviteChannel) { return; }
roster[k].curvePublic = k;
return roster[k].role === "MEMBER" || roster[k].role === "VIEWER" || !roster[k].role; return roster[k].role === "MEMBER" || roster[k].role === "VIEWER" || !roster[k].role;
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me); return makeMember(common, roster[k], me);
@ -780,6 +785,7 @@ define([
var links = Object.keys(roster).filter(function (k) { var links = Object.keys(roster).filter(function (k) {
if (!roster[k].pending) { return; } if (!roster[k].pending) { return; }
if (!roster[k].inviteChannel) { return; } if (!roster[k].inviteChannel) { return; }
roster[k].curvePublic = k;
return roster[k].role === "VIEWER" || !roster[k].role; return roster[k].role === "VIEWER" || !roster[k].role;
}).map(function (k) { }).map(function (k) {
return makeMember(common, roster[k], me); return makeMember(common, roster[k], me);

Loading…
Cancel
Save