diff --git a/src/common/common-constants.js b/src/common/common-constants.js index bae268b25..1764ffbd1 100644 --- a/src/common/common-constants.js +++ b/src/common/common-constants.js @@ -32,7 +32,7 @@ const factory = function (AppConfig = {}) { MAX_PREMIUM_TEAMS_OWNED: Math.max(AppConfig.maxOwnedTeams || 0, AppConfig.maxPremiumTeamsOwned || 0) || 5, // Apps criticalApps: ['profile', 'settings', 'debug', 'admin', 'support', 'notifications', 'calendar', 'moderation', 'oldadmin'], // XXX oldadmin - earlyAccessApps: ['doc', 'presentation'] + earlyAccessApps: [] }; }; diff --git a/src/common/common-util.js b/src/common/common-util.js index 281ea666d..4cde5968d 100644 --- a/src/common/common-util.js +++ b/src/common/common-util.js @@ -86,6 +86,12 @@ Util.mkEvent = function (once) { var handlers = []; var fired = false; + let promiseResolve; + + const promise = new Promise(resolve => { + promiseResolve = resolve; + }); + return { reg: function (cb) { if (once && fired) { return void setTimeout(cb); } @@ -99,10 +105,13 @@ }, fire: function () { if (once && fired) { return; } - fired = true; var args = Array.prototype.slice.call(arguments); + if (!fired) { promiseResolve.apply(null, args); } + fired = true; handlers.forEach(function (h) { h.apply(null, args); }); - } + }, + // Since a promise can only resolve once only the 1st call to fire() is reflected here. Even is `once` is `false`. + promise }; }; diff --git a/src/common/user-object.js b/src/common/user-object.js index c04987315..999ecd212 100644 --- a/src/common/user-object.js +++ b/src/common/user-object.js @@ -248,7 +248,7 @@ const factory = (Util, Hash, var isFolder = exp.isFolder = function (element) { if (isFolderData(element)) { return false; } - return typeof(element) === "object" || isSharedFolder(element); + return (typeof(element) === "object" && !element.channel) || isSharedFolder(element); }; exp.isFolderEmpty = function (element) { if (!isFolder(element)) { return false; }