diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index e87f2cc97..a1f939e56 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -78,6 +78,7 @@ define([ Realtime.whenRealtimeSyncs(s.realtime, waitFor()); if (s.sharedFolders && typeof (s.sharedFolders) === "object") { for (var k in s.sharedFolders) { + if (!s.sharedFolders[k].realtime) { continue; } // Deprecated Realtime.whenRealtimeSyncs(s.sharedFolders[k].realtime, waitFor()); } } diff --git a/www/common/outer/sharedfolder.js b/www/common/outer/sharedfolder.js index 907c49cd0..cbeae1cbd 100644 --- a/www/common/outer/sharedfolder.js +++ b/www/common/outer/sharedfolder.js @@ -214,6 +214,18 @@ define([ }); } catch (e) {} delete allSharedFolders[secret.channel]; + // This shouldn't be called on init because we're calling "isNewChannel" first, + // but we can still call "cb" just in case. This wait we make sure we won't block + // the initial "waitFor" + return void cb(); + } + if (info.error === "ERESTRICTED" ) { + // This shouldn't happen: allow list are disabled for shared folders + // but call "cb" to make sure we won't block the initial "waitFor" + sf.teams.forEach(function (obj) { + obj.store.manager.restrictedProxy(obj.id, secret.channel); + }); + return void cb(); } } }); diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index 29f762956..d13f242fc 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -67,6 +67,13 @@ define([ } }; + var restrictedProxy = function (Env, id, channel) { + var lm = { proxy: { deprecated: true } }; + removeProxy(Env, id); + addProxy(Env, id, lm, function () {}); + return void Env.Store.refreshDriveUI(); + }; + /* Tools */ @@ -1118,6 +1125,7 @@ define([ addProxy: callWithEnv(addProxy), removeProxy: callWithEnv(removeProxy), deprecateProxy: callWithEnv(deprecateProxy), + restrictedProxy: callWithEnv(restrictedProxy), addSharedFolder: callWithEnv(_addSharedFolder), // Drive command: callWithEnv(onCommand),