From 9b78580d8e71771cdf4091f41eb785da57130e93 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 12 Jan 2018 14:50:56 +0100 Subject: [PATCH 1/2] make usage-bar display optional --- www/common/common-ui-elements.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index ebb401b1c..03654e593 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -771,6 +771,7 @@ define([ */ var LIMIT_REFRESH_RATE = 30000; // milliseconds UIElements.createUsageBar = function (common, cb) { + if (AppConfig.hideUsageBar) { return cb('USAGE_BAR_HIDDEN'); } if (!common.isLoggedIn()) { return cb("NOT_LOGGED_IN"); } // getPinnedUsage updates common.account.usage, and other values // so we can just use those and only check for errors From 844d04df87dd408c97b9d4abff73ca56eb895531 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 12 Jan 2018 15:49:01 +0100 Subject: [PATCH 2/2] allow custom logout hooks defined in app config --- www/common/outer/local-store.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/common/outer/local-store.js b/www/common/outer/local-store.js index d5fd03623..09cc68549 100644 --- a/www/common/outer/local-store.js +++ b/www/common/outer/local-store.js @@ -2,7 +2,8 @@ define([ '/common/common-constants.js', '/common/common-hash.js', '/bower_components/localforage/dist/localforage.min.js', -], function (Constants, Hash, localForage) { + '/customize/application_config.js', +], function (Constants, Hash, localForage, AppConfig) { var LocalStore = {}; LocalStore.setThumbnail = function (key, value, cb) { @@ -115,6 +116,10 @@ define([ if (typeof (h) === "function") { h(); } }); + if (typeof(AppConfig.customizeLogout) === 'function') { + return void AppConfig.customizeLogout(cb); + } + if (cb) { cb(); } }; LocalStore.onLogout = function (h) { @@ -125,6 +130,5 @@ define([ - return LocalStore; });