From da328644132aebfc11850d660da875a1d7c57428 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 19 Nov 2019 15:45:37 +0100 Subject: [PATCH] Fix other read-only teams issues --- www/common/outer/profile.js | 4 ++-- www/common/outer/team.js | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/www/common/outer/profile.js b/www/common/outer/profile.js index 0e1e1f35e..dd56db6e9 100644 --- a/www/common/outer/profile.js +++ b/www/common/outer/profile.js @@ -20,11 +20,11 @@ define([ } profile.edit = Hash.getEditHashFromKeys(secret); profile.view = Hash.getViewHashFromKeys(secret); - cb(); + setTimeout(cb); }); return; } - cb(); + setTimeout(cb); }; var openChannel = function (ctx) { diff --git a/www/common/outer/team.js b/www/common/outer/team.js index b1be2baea..314d33f88 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -25,10 +25,6 @@ define([ var Nacl = window.nacl; - var initializeTeams = function (ctx, cb) { - cb(); - }; - var registerChangeEvents = function (ctx, team, proxy, fId) { if (!team) { return; } if (!fId) { @@ -338,7 +334,7 @@ define([ }; var openChannel = function (ctx, teamData, id, _cb) { - var cb = Util.once(_cb); + var cb = Util.once(Util.mkAsync(_cb)); var hash = teamData.hash || teamData.roHash; var secret = Hash.getSecrets('team', hash, teamData.password); @@ -1277,10 +1273,6 @@ define([ var teams = store.proxy.teams = store.proxy.teams || {}; - initializeTeams(ctx, waitFor(function (err) { - if (err) { return; } - })); - // Listen for changes in our access rights (if another worker receives edit access) ctx.store.proxy.on('change', ['teams'], function (o, n, p) { if (p[2] !== 'hash') { return; }