From e6c948febb8a911dbc9b9fc422ac9be9d11dfbcc Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 20 Feb 2020 12:12:22 +0100 Subject: [PATCH] Display ERESTRICTED error in the UI --- www/common/common-ui-elements.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index fe38c06ed..882f7d027 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -3588,7 +3588,7 @@ define([ }; UIElements.onServerError = function (common, err, toolbar, cb) { - if (["EDELETED", "EEXPIRED"].indexOf(err.type) === -1) { return; } + if (["EDELETED", "EEXPIRED", "ERESTRICTED"].indexOf(err.type) === -1) { return; } var priv = common.getMetadataMgr().getPrivateData(); var msg = err.type; if (err.type === 'EEXPIRED') { @@ -3602,11 +3602,13 @@ define([ if (err.loaded) { msg += Messages.errorCopy; } + } else if (err.type === 'ERESTRICTED') { + msg = Messages.restrictedError || "RESTRICTED"; // XXX } var sframeChan = common.getSframeChannel(); sframeChan.event('EV_SHARE_OPEN', {hidden: true}); if (toolbar && typeof toolbar.deleted === "function") { toolbar.deleted(); } - UI.errorLoadingScreen(msg, true, true); + UI.errorLoadingScreen(msg, Boolean(err.loaded), Boolean(err.loaded)); (cb || function () {})(); };