diff --git a/www/common/outer/sharedfolder.js b/www/common/outer/sharedfolder.js index 888c0b426..4b1482556 100644 --- a/www/common/outer/sharedfolder.js +++ b/www/common/outer/sharedfolder.js @@ -98,7 +98,7 @@ define([ var parsed = Hash.parsePadUrl(href); var secret = Hash.getSecrets('drive', parsed.hash, data.password); - // If we don' have valid keys, abort and remove the proxy to make sure + // If we don't have valid keys, abort and remove the proxy to make sure // we don't block the drive permanently if (!secret.keys) { store.manager.deprecateProxy(id); diff --git a/www/common/outer/userObject.js b/www/common/outer/userObject.js index a254911bf..6fce3a936 100644 --- a/www/common/outer/userObject.js +++ b/www/common/outer/userObject.js @@ -168,6 +168,7 @@ define([ if (channelId) { toClean.push(channelId); } if (exp.isSharedFolder(id)) { delete files[SHARED_FOLDERS][id]; + if (config.removeProxy) { config.removeProxy(id); } } else { spliceFileData(id); } diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index df5aa131b..007a20cfe 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -49,7 +49,6 @@ define([ return userObject; }; - // XXX: Remove a shared folder from the list var removeProxy = function (Env, id) { var f = Env.folders[id]; if (!f) { return; } @@ -63,11 +62,13 @@ define([ // In a read-only team, we can't deprecate a shared folder // Use a empty object with a deprecated flag... var lm = { proxy: { deprecated: true } }; + removeProxy(Env, id); addProxy(Env, id, lm, function () {}); return void Env.Store.refreshDriveUI(); } if (channel) { Env.unpinPads([channel], function () {}); } Env.user.userObject.deprecateSharedFolder(id); + removeProxy(Env, id); if (Env.Store && Env.Store.refreshDriveUI) { Env.Store.refreshDriveUI(); } @@ -1065,10 +1066,13 @@ define([ settings: data.settings, user: { proxy: proxy, - userObject: UserObject.init(proxy, uoConfig) }, folders: {} }; + uoConfig.removeProxy = function (id) { + removeProxy(Env, id); + }; + Env.user.userObject = UserObject.init(proxy, uoConfig); var callWithEnv = function (f) { return function () {